0

「конект」という名前のモデム アダプタを切断/接続しようとしましたが、アダプタの名前にロシア語の文字が含まれているため、機能しません。強制的に機能させる方法は?助けてください。

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();
    }

[アダプターの名前を英字とコードで変更するだけで機能することはわかっていますが、強制的にロシア文字で機能させる方法を知りたいです]

4

1 に答える 1