VBScript部分我已经编好了 就是不懂javaScript 想马上改到javaScript
解决方案 »
- ssh中HQL语句
- 用Xstream解析xml转成javabean
- response.sendRedirect()的用法,能保持request 中的值吗?
- 大家一定用过IP地址速查吧(http://www.ip138.com/),这个网站是怎么知道某个IP是哪里的?
- ssh框架中也到了一起奇怪的问题! 急!!
- JMS小问题
- Struts + Hibernate +SQLserver2000 开发问题
- 页面刷新后,每次数据输出顺序都不一样
- java private问题,快来解释一下,谢谢~!
- struts打印或导出EXCEL
- 关于jspSmartUpload多文件下载的问题
- 烦 烦 烦啊!COOKIE问题,怎么获取不到值 大家看看 ``啊
Dim Fso
Dim objHandle
Dim aData
Dim bFound
Dim strWork
Dim aWork
Dim I
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Set objHandle = Fso.OpenTextFile( strPath, 1 )
aData = Split( objHandle.ReadAll, vbCrLf )
objHandle.Close
Set objHandle = Nothing
Set Fso = Nothing
GetProfileString = Empty
bFound = False
For I = 0 to Ubound( aData )-1
if bFound then
if Left( aData( I ), 1 ) = "[" then
Exit For
end if
strWork = LTrim( aData( I ) )
if Left( strWork, Len(strEntry)) = strEntry then
aWork = Split( strWork, "=" )
if Trim(aWork(0)) = strEntry then
if Ubound( aWork ) = 1 then
GetProfileString = Trim( aWork( 1 ) )
Exit For
end if
end if
end if
end if
if aData(I) = "[" & strSection & "]" then
bFound = True
end if
Next
End Function
Dim Fso
Dim objHandle,aData,bFound,strWork,aWork,I,nSection,bReplace
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Set objHandle = Fso.OpenTextFile( strPath, 1 )
aData = Split( objHandle.ReadAll, vbCrLf )
objHandle.Close
Set objHandle = Nothing
Set Fso = Nothing
bReplace = False
bFound = False
For I = 0 to Ubound( aData )-1
if bFound then
if Left( aData( I ), 1 ) = "[" then
Exit For
end if
strWork = LTrim( aData( I ) )
if Left( strWork, Len(strEntry)) = strEntry then
aWork = Split( strWork, "=" )
if Trim(aWork(0)) = strEntry then
if Ubound( aWork ) = 1 then
strWork = Trim( aWork( 1 ) )
aData( I ) = Replace( aData( I ), strWork, strValue )
strWork = Join( aData, vbCrLf )
Set objHandle = Fso.OpenTextFile( strPath, 2, True )
objHandle.Write strWork
objHandle.Close
bReplace = True
Exit For
end if
end if
end if
end if
if aData(I) = "[" & strSection & "]" then
nSection = I
bFound = True
end if
Next
if not bReplace then
if bFound then
aData(nSection) = aData(nSection) & _
vbCrLf & strEntry & "=" & strValue
strWork = Join( aData, vbCrLf )
Set objHandle = Fso.OpenTextFile( strPath, 2, True )
objHandle.Write strWork
objHandle.Close
else
aData(Ubound( aData )-1) = aData(Ubound( aData )-1) & _
vbCrLf & "[" & strSection & "]" & _
vbCrLf & strEntry & "=" & strValue
strWork = Join( aData, vbCrLf )
Set objHandle = Fso.OpenTextFile( strPath, 2, True )
objHandle.Write strWork
objHandle.Close
end if
end if
End Function
这两种Script可以同时在页面中使用啊。
别费那劲了,用VBScript挺好