首页 > Windows开发 > 详细

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

时间:2021-03-15 11:19:57      阅读:61      评论:0      收藏:0      [点我收藏+]
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文件

原文:https://www.cnblogs.com/congqiandehoulai/p/14535968.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!