本文介绍了CSharp .exe复制我该怎么办=?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好!程序本身在打开时的副本.我能怎么做 . ??
Hİ! Copies of the program itself when opened. how can i do . ??
private void Form1_Load(object sender, EventArgs e) { Copies of the program itself. C:/ (how can I do ?) }推荐答案
使用 Application.ExecutablePath属性 [ ^ ]获取当前路径和文件名,然后使用文件复制方法 [ ^ ]将文件复制到新文件夹. 也许使用路径类 [ ^ ]来获得诸如文件夹本身或文件名之类的内容,然后组合一个使用File.Copy之前的新路径. Use Application.ExecutablePath Property[^] to get the current path and file name and then use File.Copy Method[^] to copy the file to a new folder. Perhaps use Path class[^] to get something like folder it self or file name and then combine a new path before use of File.Copy.
File.Copy("MyApplication.exe", @"C:\path\MyApplication.exe");
更多推荐
CSharp .exe复制我该怎么办=?
发布评论