开发者

I want my C# winforms program to copy it self to system32

I've made a C开发者_如何学运维# windows forms application and want this application to copy itself (the file of the program) to the system32 of the current system. I want such function:

function copyProg() {
   //copy the program to the system32 of current windows version...
   //return the new url
}


This is a "bad idea" and "frowned upon". A cleaner and more accepted practice is to create an environment variable that points to your applications startup directory.

string localPath = Application.StartupPath;
Environment.SetEnvironmentVariable("EXAMPLE", localPath);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜