fixed a bug
This commit is contained in:
@@ -12,11 +12,14 @@ namespace Writer
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
private static readonly HttpClient http = new HttpClient();
|
||||
private static readonly string ServerUrl = System.IO.File.ReadAllText("appsettings.json")
|
||||
.Replace("\"", "")
|
||||
.Split(':')[1]
|
||||
.Replace("/", "")
|
||||
.Trim();
|
||||
private static readonly string ServerUrl;
|
||||
|
||||
static MainForm()
|
||||
{
|
||||
var configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
|
||||
var jsonContent = System.IO.File.ReadAllText(configPath);
|
||||
ServerUrl = jsonContent.Replace("\"", "").Split(':')[1].Replace("/", "").Trim();
|
||||
}
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user