积极答复者
VB.NET实现文本文件中特定字符的替换

问题
答案
-
我要实现把文本文件中的参数替换为数字,比如textbook1中输入100则文本中对应的参数值就变为100.求高人指教
Hi,
我也比较推荐先分享你的文件结构以方便我们提供比较高效率的建议。
如果忽略性能问题的话, 这里有一个简单对于txt文件的例子。
My.Computer.FileSystem.WriteAllText("C:\test2.txt", My.Computer.FileSystem.ReadAllText("C:\test.txt").Replace("oldvalue", "newvalue"), False)
Sting.Replace:
http://msdn.microsoft.com/zh-cn/library/fk49wtc1(v=vs.110).aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已编辑 Carl CaiModerator 2014年8月4日 10:13
- 已标记为答案 Carl CaiModerator 2014年8月6日 9:45
全部回复
-
-
我要实现把文本文件中的参数替换为数字,比如textbook1中输入100则文本中对应的参数值就变为100.求高人指教
Hi,
我也比较推荐先分享你的文件结构以方便我们提供比较高效率的建议。
如果忽略性能问题的话, 这里有一个简单对于txt文件的例子。
My.Computer.FileSystem.WriteAllText("C:\test2.txt", My.Computer.FileSystem.ReadAllText("C:\test.txt").Replace("oldvalue", "newvalue"), False)
Sting.Replace:
http://msdn.microsoft.com/zh-cn/library/fk49wtc1(v=vs.110).aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已编辑 Carl CaiModerator 2014年8月4日 10:13
- 已标记为答案 Carl CaiModerator 2014年8月6日 9:45