C#代码修改.resource文件为.resx文件

static void Convert(string resourcesFilePath)
        {
            Process p = new Process();
            p.StartInfo.FileName = "cmd.exe ";

            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            //p.StartInfo.CreateNoWindow = false;


            p.Start();

            //+ ‘"‘ + ‘"‘ + can replace
            p.StandardInput.WriteLine("%comspec% /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\Tools\\VsDevCmd.bat\"");

            Console.WriteLine(resourcesFilePath);
            p.StandardInput.WriteLine(" resgen " + resourcesFilePath + " " + resourcesFilePath.Replace(".resources", ".resx"));

            p.StandardInput.WriteLine("  ");
            p.StandardInput.Flush();
            p.StandardInput.WriteLine(" exit ");

            //Exit cmd.exe
            p.StandardInput.WriteLine(" exit ");
            p.WaitForExit();
            var s = p.StandardOutput.ReadToEnd();
            Console.WriteLine("s_________________________________________________SSSSSSSSSSSSSSSSSSSSSSSSSS");
            Console.WriteLine(s);
            p.Close();


        }

 

C#代码修改.resource文件为.resx文件

上一篇:* for Windows 汉化版使用简介


下一篇:第20节、C#Hashtable类:哈希表