哪位大神帮我看看这个环境变量为什么会报错,怎么解决
上一篇 /
下一篇 2016-08-11 17:48:11
/ 个人分类:原创
'初始化环境变量
getvariable allEnvVar,"url","https://www.baidu.com"
getvariable allEnvVar,"username","jieyu"
getvariable allEnvVar,"password","123456"
'生成外部环境变量XML文件
generateenvfile "D:\test.xml",allEnvVar
'动态加载环境变量
environment.LoadFromFile "D:\test.xml"
url=environment.Value("url")
username=environment.Value("username")
pwd=environment.Value("password")
systemutil.Run url
Function getvariable(byref xmlvar,byval varname,byval varvalue)
xmlvar=xmlvar+"<variable>"+vbcrlf+"<name>"+varname+"</name>"+vbcrlf+"<value>"+varvalue+"</value>"+vbcrlf+"</variable>"+vbcrlf
End Function
Function generateenvfile(envpathname,getvar)
envstream="<environment>"+vbcrlf+getvar+"</environment>"
Set fso=createobject("scripting.filesystemobject")
Set envstreamfile=fso.CreateTextFile(envpathname)
envstreamfile.Write envstream
Set envstreamfile=nothing
Set fso=nothing
End Function
报的错如下所示:
The environment parameter "url" was not found. Confirm that an environment parameter with this name is defined or specify another environment variable.
Line (24): "url=environment.Value("url")".
收藏
举报
TAG: