FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)
byte[] infbytes = new byte[(int)fs.Length]
fs.Read(infbytes, 0, infbytes.Length)
fs.Close()
return infbytes
2、将字节流写入文件
FileStream fs = new FileStream("D:\\inf.dlv", FileMode.Create, FileAccess.Write)
fs.Write(inf, 0, inf.Length)
fs.Close()
Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As LongPublic Sub WriteIniFileInfo(IniFileName As String, GroupTitle As String, Flags As String, SettingInfo As String)
WritePrivateProfileString GroupTitle, Flags, SettingInfo, IniFileName
End Sub
上面是准备工作,然后把下面这句填到你的那个地方去,是保存到当前目录下的run.ini文件中
Call WriteIniFileInfo(App.Path &"\run.ini", "运行参数", "usb_key_id", Str(usb_key_id))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)