C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,997 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
How can i use the string "server_token_string" outside of the using?
using (StreamReader sr = new StreamReader(@$"{localappdata}\Liquid Aqua\API\server_token.txt", Encoding.Default))
{
StringBuilder server_tokens = new StringBuilder();
// schreibt Zeile für Zeile auf den StringBuilder bis das Ende der Datei erreicht ist
while (!sr.EndOfStream)
server_tokens.AppendLine(sr.ReadLine()); fortschritt_label.Content = "Reading Server File..."; progress_bar.Value = 6;
string server_token_string = Convert.ToString(server_tokens);
}
Try something like this:
string server_token_string;
using ( . . .)
{
. . .
server_token_string = server_tokens.ToString( );
}