CSharp .exe复制我该怎么办=?

编程入门 行业动态 更新时间:2024-10-09 09:22:42
本文介绍了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复制我该怎么办=?

本文发布于:2023-11-02 06:08:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551582.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我该   CSharp   exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!