c#如何设置环境路径(到现有路径) [英] c# How do you set a environment path ( to a existing one )

查看:197
本文介绍了c#如何设置环境路径(到现有路径)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我为treyarch游戏开发了mod,我拥有适用于bo3的mod工具,并且我正在尝试创建一个程序,该程序将为环境路径添加路径,因此一旦进入环境路径,其外观如下所示:

Ok i mod for treyarch games i have mod tools for bo3 and i am trying to create a program that will add a path to environment paths so once in the environment path it looks like the following 

我添加了手动选择的路径,只是为了显示我想做的事,我想通过我的程序将该路径添加到可变路径"部分,这是我尝试过的,但是没有运气 

i added in the path selected manually just to show what i wanted to do i want to add that path in via my program into the Variable Path part this is what i have tried but no luck  

            var startInfo = new ProcessStartInfo();


            startInfo.EnvironmentVariables["Path"] = "test";

            // Required for EnvironmentVariables to be set
            startInfo.UseShellExecute = false;

            startInfo.FileName = "cmd.exe";

            Process.Start(startInfo);

但是我似乎无法使其正常工作,所有示例使我感到困惑,就像我看过Microsoft的示例一样,但是它做其他事情,并且永远不会编辑已经存在的示例并在其中添加一行. >

but i cant seem to get it to work right and all the examples confuse me like i have looked at examples form Microsoft but it does other things and not ever edit one that is already there and add a line to it. 

推荐答案

嗨Elfenliedtopfan2,

也许这个答案可以帮助您
在此处链接

Hi Elfenliedtopfan2,

Maybe this answer help you 
Link here

希望能对您有所帮助...

I hope help...


这篇关于c#如何设置环境路径(到现有路径)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆