fixed a bug
This commit is contained in:
@@ -19,7 +19,9 @@ namespace Reader
|
|||||||
{
|
{
|
||||||
var configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
|
var configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
|
||||||
var jsonContent = System.IO.File.ReadAllText(configPath);
|
var jsonContent = System.IO.File.ReadAllText(configPath);
|
||||||
ServerUrl = jsonContent.Replace("\"", "").Split(':')[1].Replace("/", "").Trim();
|
var start = jsonContent.IndexOf('"', jsonContent.IndexOf("ServerUrl") + 10);
|
||||||
|
var end = jsonContent.IndexOf('"', start + 1);
|
||||||
|
ServerUrl = jsonContent.Substring(start + 1, end - start - 1).Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainForm()
|
public MainForm()
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ namespace Writer
|
|||||||
{
|
{
|
||||||
var configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
|
var configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
|
||||||
var jsonContent = System.IO.File.ReadAllText(configPath);
|
var jsonContent = System.IO.File.ReadAllText(configPath);
|
||||||
ServerUrl = jsonContent.Replace("\"", "").Split(':')[1].Replace("/", "").Trim();
|
var start = jsonContent.IndexOf('"', jsonContent.IndexOf("ServerUrl") + 10);
|
||||||
|
var end = jsonContent.IndexOf('"', start + 1);
|
||||||
|
ServerUrl = jsonContent.Substring(start + 1, end - start - 1).Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainForm()
|
public MainForm()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="appsettings.json">
|
<None Update="appsettings.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user