社区
C#
帖子详情
file.create和streamWriter
markdandan
2009-03-16 10:11:37
file.create()和streamWriter好像都能创建一个文件,请问他们有什么区别吗?
...全文
86
1
打赏
收藏
file.create和streamWriter
file.create()和streamWriter好像都能创建一个文件,请问他们有什么区别吗?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
markdandan
2009-03-16
打赏
举报
回复
自己顶!!
06:
File
.pdf
将指定的字符串追加到文件中,如果文件还不存在则创建该文件。 public static void AppendAllText(string path, string contents); public static void AppendAllText(string path, string contents, Encoding encoding); //path 途径,contents 目录;内容;Encoding编码 public static
StreamWriter
AppendText(string path); const string
file
Path = @"d:\
File
Create
OpenDemo.txt"; using (Stream s =
File
.
Create
(
file
Path)) {
C# 向文件写入文本
C# 向文件写入文本C# 向文件写入文本C# 向文件写入文本C# 向文件写入文本C# 向文件写入文本C# 向文件写入文本
C# 打包 zip
private void Unzip(string
file
Path1, string urlid) { if (Directory.Exists(Server.MapPath("ziptemp/" + urlid)) == false) { Directory.
Create
Directory(Server.MapPath("ziptemp/" + urlid)); } ZipInputStream s = new ZipInputStream(
File
.OpenRead(
file
Path1)); ZipEntry theEntry; while ((theEntry = s.GetNextEntry()) != null) { string fullname = Server.MapPath("ziptemp/" + urlid + "/" + theEntry.Name); string directoryName = Path.GetDirectoryName(fullname); string
file
Name = Path.Get
File
Name(fullname); if (!Directory.Exists(directoryName)) Directory.
Create
Directory(directoryName); if (
file
Name != String.Empty) {
File
Stream
streamWriter
=
File
.
Create
(fullname); int size = 2048; byte[] data = new byte[2048]; while (true) { size = s.Read(data, 0, data.Length); if (size > 0)
streamWriter
.Write(data, 0, size); else break; }
streamWriter
.Close(); } } s.Close(); }
向txt文件里写字
向txt文件里写字!!!!!!!
C#动态创建文件并写入txt.zip_C#动态创建文件并写入txt_c# 创建文件_c#写入txt文件_txt
C#动态创建文件并写入txt示例 C#动态创建文件并写入txt
C#
111,126
社区成员
642,540
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章