I tried to disconnect/connect my modem adapter, named as "конект", but it doesn't work, because adapter's name contains Russian letters. How to force it to work? Please help.
Connect("конект", "", "", true);
public static void Connect(string adapter, string login, string pass, bool discon)
{
string cmd = "";
if (discon)
{
cmd = "rasdial " + '"' + adapter + '"' + @" /disconnect";
}
else
{
cmd = "rasdial " + '"' + adapter + '"' + " " + login + " " + pass;
}
Cmd(cmd);
}
public static void Cmd(string URL)
{
ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe");
Process p = new Process();
startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = true;
p = Process.Start(startInfo);
p.StandardInput.WriteLine(URL);
p.StandardInput.WriteLine(@"EXIT");
p.WaitForExit();
p.Close();
}
[I know that need just rename adapter with English letters and code will work, but I want to know how to force it work with Russian letters]