求助...如何修改richtextbox的某行文字然後用StreamWriter保存至ini文档?
如题...richtextbox的文字
xx = yy
pn = 123
yy=zz
,然后把pn = 123修改成pn = 321,保存至ini文档..
Private Sub changename()
If File.Exists(hello.ini) Then
‘Using sw As StreamWriter = New StreamWriter(hello.ini)
‘???
‘End Using
Else
File.create"hello.ini"
changename()
End If
End Sub
另外,如何把文件保存为UTF-8? --------------------编程问答-------------------- replace替换内容
StreamWriter sw = new StreamWriter("", false, Encoding.GetEncoding("utf-8"));
sw.Flush();
sw.WriteLine(“”);
sw.Close();
或调用API WritePrivateProfileString --------------------编程问答--------------------
具体一点...?
--------------------编程问答-------------------- 关注!______________________________________________ --------------------编程问答-------------------- 读写操作INI文件,规范的用法是用WINAPI的两个函数:
Private Declare Function GetPrivateProfileString()Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Int32, ByVal lpFileName As String) As Int32
Private Declare Function WritePrivateProfileString()Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Int32
实例参考:http://www.cnblogs.com/aowind/archive/2005/02/06/102723.aspx --------------------编程问答--------------------
补充:.NET技术 , VB.NET