• 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();
    
    
            }
  • 相关阅读:
    怎么说???
    再给自己一点鼓励
    还是不要看新闻的好
    系统架构师
    朋友
    未来的路
    I now have a dream
    纪念死去的手机
    全局规划
    终于要上战场了!
  • 原文地址:https://www.cnblogs.com/congqiandehoulai/p/14535968.html
Copyright © 2020-2023  润新知