asp中 include file 包含其他文件
vbs中
复制代码 代码如下:
Option Explicit
On Error Resume Next
Sub include(vbs)
Dim fso : Set fso = CreateObject("scripting.FileSystemObject")
Dim p : p = Split(Wscript.ScriptFullName,"\")
p(UBound(p)) = vbs
p = Join(p,"\")
Dim f : Set f = fso.OpenTextFile(p)
Execute f.ReadAll()
' ExecuteGlobal f.ReadAll()
f.Close()
Set f = Nothing
Set fso = Nothing
' Wscript.Echo(p)
End Sub
include("1.vbs")
include("2.vbs")
'If Err Then
' Wscript.Echo(Err.description)
' Wscript.Quit()
'End If
Wscript.Echo(a+b)
1.vbs
a = 3
2.vbs
b = 4
vbs中
复制代码 代码如下:
Option Explicit
On Error Resume Next
Sub include(vbs)
Dim fso : Set fso = CreateObject("scripting.FileSystemObject")
Dim p : p = Split(Wscript.ScriptFullName,"\")
p(UBound(p)) = vbs
p = Join(p,"\")
Dim f : Set f = fso.OpenTextFile(p)
Execute f.ReadAll()
' ExecuteGlobal f.ReadAll()
f.Close()
Set f = Nothing
Set fso = Nothing
' Wscript.Echo(p)
End Sub
include("1.vbs")
include("2.vbs")
'If Err Then
' Wscript.Echo(Err.description)
' Wscript.Quit()
'End If
Wscript.Echo(a+b)
1.vbs
a = 3
2.vbs
b = 4
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
内蒙古资源网 Copyright www.nmgbbs.com
暂无“在一个vbs中包含其他vbs文件的方法”评论...