private void copy()
{
string [email protected]"c:/documents and settings/administrator/「開始」菜單/程序/啟動/shut_explorer.exe";
// string path = system.io.directory.getcurrentdirectory()+"http://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");
}
新聞熱點
疑難解答