private void copy()
{
string [email protected]"c:/documents and settings/administrator/「开始」菜单/程序/启动/shut_explorer.exe";
// string path = system.io.directory.getcurrentdirectory()+"//shut_explorer.exe"; //??
string path=system.diagnostics.process.getcurrentprocess().mainmodule.filename;//这种方法好,可以动态获取
if(!system.io.file.exists(aimpath))
{
system.io.file.copy(path,aimpath);
}
}
//创建文本
string [email protected]"c:/documents and settings/administrator//桌面/aa.txt";
if(!file.exists(path))
{
using(streamwriter sw=file.createtext(path))
{
sw.write("开始了");
}
}
//追加文本
using(streamwriter sw=file.appendtext(path))
{
sw.writeline(boardid+"以完成");
}
//另一种创建文本
using(streamwriter sw=new streamwriter(path,false,encoding.utf8))//注意quickchm支持utf8编码
{
sw.write("ererere");
}
新闻热点
疑难解答