All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
C#教程:套接字使用实例
php实现下载功能_php资料_编程技术
asp.net2.0网站基础之创建ASP.NET 2.0网站
Zope的优点及和Apache+PHP+MySQL的比较_php资料_编程技术
PHP实例:用PHP实现多文件上载系统程序_php资料_编程技术
关于phpwind,5.01-5.3,0day的分析文章_php资料_编程技术
目录,文件操作详谈—php_php资料_编程技术
delphi无类型文件
delphi事件的定义及作用
ASP.NET部署与安装_MSI制作图文教程_[Asp.Net教程]
Reading number is top 10 pictures
Sora aoi in China1
29 the belle stars after bath figure3
西游四格漫画(五)
你的钱干净吗?
China's first snake village3
Beautiful Japanese beauty(漂亮的日本美女)2
Beautiful vacuum girl2
福利是必须的
何炅哥为中国人的平均工资鸣不平了
Female model behind the bitterness, often being overcharged3
Download software ranking
实战黑客不求人
Boxer's Top ten classic battle4
Visual C++界面编程技术
Kung fu panda - the secret of the teacher
艳兽都市
Sora aoi, the nurse, uniform ,nursing assistant
jdk1.5
asp.net技术内幕
Boxer's Top ten classic battle10
Red cliff
delv published in(发表于) 2014/1/10 6:29:16 Edit(编辑)
C#对文件的操作_[Asp.Net教程]

C#对文件的操作_[Asp.Net教程]

C#对文件的操作_[Asp.Net教程]

private void Copy()
{
string aimpath=@"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 path=@"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");
}


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.