'用一个字符串去替代文件中的另一个字符串
Function ReplaceStrInFile(ByVal FileName As String, ByVal Str1 As String, ByVal Str2 As String) As Int16
If System.IO.File.Exists(FileName) = True Then
Dim Temp As String
Temp = System.IO.File.ReadAllText(FileName)
Temp = Replace(Temp, Str1, Str2)
System.IO.File.WriteAllText(FileName, Temp)
End If
End Function
Function ReplaceStrInFile(ByVal FileName As String, ByVal Str1 As String, ByVal Str2 As String) As Int16
If System.IO.File.Exists(FileName) = True Then
Dim Temp As String
Temp = System.IO.File.ReadAllText(FileName)
Temp = Replace(Temp, Str1, Str2)
System.IO.File.WriteAllText(FileName, Temp)
End If
End Function
|
|
暂时没有评论
| 发表评论 - 不要忘了输入验证码哦! |
用户登陆
站点日历
站点统计
最新评论
VB.Net用一个字符串去替代文件中的另一个字符串 [ 日期:2010-03-01 ] [ 来自: