怎么搞的,让你看最后一个参数,你说第一个参数是String???? Text1.Text = Replace("how can I do this", "how", "replace function ", , , vbBinaryCompare) 这其实是默认的方式我想在文件当中替换字符串完全可以 dim byt1() as byte dim s1 String dim byt2() as byte dim s2 String byt1=..... byt2=..... s1=byt1 s2=byt2 dim target() as byte target=replace(yourStrfromfile,s1,s2)
ozw(沧浪客) :感谢你,是你提醒了我,尽管你没有完全回答对. 其实replace的第一个参数可以是字节数组,返回值也可以是字节数组.二进制文件中的字符串实际上还是以文本方式保存的.所以第二个参数和第三个参数用字符串也是可以的.最后一个参数我没有使用. 我是这样使用的: 源程序中有这么一个语句: xx="xxxxxxxxxxxxxxx" winsock1.remotehost=trim(xx) 我在另一个程序中写道: dim a() as byte dim b as string*15 ........( 将文件读入数组a()) b=inputbox("please input ip address:") a=replace(a,string(15,"x"),b) ......(将a写回文件)
exe文件,而你又要改这个文件,系统是不允许的
http://www.csdn.net/expert/topic/197/197661.shtm
Text1.Text = Replace("how can I do this", "how", "replace function ", , , vbBinaryCompare)
这其实是默认的方式我想在文件当中替换字符串完全可以
dim byt1() as byte
dim s1 String
dim byt2() as byte
dim s2 String
byt1=.....
byt2=.....
s1=byt1
s2=byt2
dim target() as byte
target=replace(yourStrfromfile,s1,s2)
其实replace的第一个参数可以是字节数组,返回值也可以是字节数组.二进制文件中的字符串实际上还是以文本方式保存的.所以第二个参数和第三个参数用字符串也是可以的.最后一个参数我没有使用.
我是这样使用的:
源程序中有这么一个语句:
xx="xxxxxxxxxxxxxxx"
winsock1.remotehost=trim(xx)
我在另一个程序中写道:
dim a() as byte
dim b as string*15
........( 将文件读入数组a())
b=inputbox("please input ip address:")
a=replace(a,string(15,"x"),b)
......(将a写回文件)