Private Sub Command1_Click()
Dim buff() As Byte
Dim l As Long
Dim filename As String
filename = "f:\zy.txt"
l = FileLen(filename)
ReDim buff(l - 1)
Open filename For Binary As #1
Get #1, , buff
Close #1
Dim s As String
s = StrConv(buff, vbUnicode)
s=Replace( s, "zydb.mdb", Text1.Text)'我犯了一个低级错误,没指定返回值
Kill filename
Open filename For Binary As #1
Put #1, , s
Close #1
End Sub
Private Sub Command1_Click()
Dim buff() As Byte
Dim l As Long
Dim filename As String
filename = "f:\zy.txt"
l = FileLen(filename)
ReDim buff(l - 1)
Open filename For Binary As #1
Get #1, , buff
Close #1
Dim s As String
s = StrConv(buff, vbUnicode)
Replace s, "zydb.mdb", Text1.Text
Kill filename
Open filename For Binary As #1
Put #1, , s
Close #1
End Sub
dim buff() as byte
dim l as long
dim filename as string
filename="你的文件路径"
l=filelen(filename)
redim buff(l-1)
open filename for binary as #1
get #1,,buff
close #1
dim s as string
s=strconv(buff,vbunicode)
Replace s, "要替换的内容", text1.Text
kill filename
open filename for binary as #1
put #1,,s
close #1