Estal
Estal
Explore posts from servers
CC#
Created by hulton fogan on 1/22/2023 in #help
❔ What could be causing the following issue (Method not found):
I'm finding something similar, but not exact where they needed the package from
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
and had to add the following usings to their directive
using System.Reflection;
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
using Microsoft.Extensions.FileProviders;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
using Microsoft.Extensions.FileProviders;
6 replies
CC#
Created by hulton fogan on 1/22/2023 in #help
❔ What could be causing the following issue (Method not found):
Is it reliant on a Nugent Package?
6 replies
CC#
Created by Estal on 1/13/2023 in #help
❔ Replace multiple Lines
PS. The Reason to reread it at the end there is that it should have all new values, so if they choose to display changes it helps to verify the file was actually changed
12 replies
CC#
Created by Estal on 1/13/2023 in #help
❔ Replace multiple Lines
Okay, When you said why would you want to read the file you just saved it made me think some more. The answer was so obvious, so THANK YOU. Simply changed the data to
C#
string FullConfig = File.ReadAllText(ConfigFile);
FullConfig = FullConfig.Replace("SessionName=\"" + LoadSetting(ConfigFile, "SessionName") + "\"", "SessionName=\"" + serverName.Text + "\"");
FullConfig = FullConfig.Replace("JoinPassword=\"" + LoadSetting(ConfigFile, "JoinPassword") + "\"", "JoinPassword=\"" + serverPass.Text + "\"");
FullConfig = FullConfig.Replace("AdminPassword=\"" + LoadSetting(ConfigFile, "AdminPassword") + "\"", "AdminPassword=\"" + adminPass.Text + "\"");
FullConfig = FullConfig.Replace("MaxPlayers=" + LoadSetting(ConfigFile, "MaxPlayers"), "MaxPlayers=" + maxPlayers.Text);
FullConfig = FullConfig.Replace("ShutdownIfNotJoinedFor=" + LoadSetting(ConfigFile, "ShutdownIfNotJoinedFor"), "ShutdownIfNotJoinedFor=" + shutDownNotJoined1.Text);
FullConfig = FullConfig.Replace("ShutdownIfEmptyFor=" + LoadSetting(ConfigFile, "ShutdownIfEmptyFor"), "ShutdownIfEmptyFor=" + shutdownEmpty.Text);
FullConfig = FullConfig.Replace("ResumeProspect=" + LoadSetting(ConfigFile, "ResumeProspect"), "ResumeProspect=" + GetResumeStatus());
File.WriteAllText(ConfigFile, FullConfig);
string FinalConfig = File.ReadAllText(ConfigFile);
if (displayChanges.IsChecked == true)
{
MessageBox.Show(FinalConfig);
}
C#
string FullConfig = File.ReadAllText(ConfigFile);
FullConfig = FullConfig.Replace("SessionName=\"" + LoadSetting(ConfigFile, "SessionName") + "\"", "SessionName=\"" + serverName.Text + "\"");
FullConfig = FullConfig.Replace("JoinPassword=\"" + LoadSetting(ConfigFile, "JoinPassword") + "\"", "JoinPassword=\"" + serverPass.Text + "\"");
FullConfig = FullConfig.Replace("AdminPassword=\"" + LoadSetting(ConfigFile, "AdminPassword") + "\"", "AdminPassword=\"" + adminPass.Text + "\"");
FullConfig = FullConfig.Replace("MaxPlayers=" + LoadSetting(ConfigFile, "MaxPlayers"), "MaxPlayers=" + maxPlayers.Text);
FullConfig = FullConfig.Replace("ShutdownIfNotJoinedFor=" + LoadSetting(ConfigFile, "ShutdownIfNotJoinedFor"), "ShutdownIfNotJoinedFor=" + shutDownNotJoined1.Text);
FullConfig = FullConfig.Replace("ShutdownIfEmptyFor=" + LoadSetting(ConfigFile, "ShutdownIfEmptyFor"), "ShutdownIfEmptyFor=" + shutdownEmpty.Text);
FullConfig = FullConfig.Replace("ResumeProspect=" + LoadSetting(ConfigFile, "ResumeProspect"), "ResumeProspect=" + GetResumeStatus());
File.WriteAllText(ConfigFile, FullConfig);
string FinalConfig = File.ReadAllText(ConfigFile);
if (displayChanges.IsChecked == true)
{
MessageBox.Show(FinalConfig);
}
12 replies
CC#
Created by Estal on 1/13/2023 in #help
❔ Replace multiple Lines
I'll give it a go. New approach for me. Thanks
12 replies
CC#
Created by Estal on 1/13/2023 in #help
❔ Replace multiple Lines
that just feels like a headache though lol
12 replies
CC#
Created by Estal on 1/13/2023 in #help
❔ Replace multiple Lines
Suppose I could have it read->Serialize->Update->SaveNew->ReadNew->Deserialize->Save
12 replies
CC#
Created by Estal on 1/13/2023 in #help
❔ Replace multiple Lines
Unfortunately it's not. 😦 It's an ini file for a server that the program handles.
12 replies
CC#
Created by Estal on 1/12/2023 in #help
❔ Updating text on main thread from running application WPF C Sharp
I got it working. Seems like it's a steamcmd thing, but on the server it runs it's got a decent delay as well, so will look into that.
6 replies
CC#
Created by Estal on 1/12/2023 in #help
❔ Updating text on main thread from running application WPF C Sharp
will do. thanks
6 replies