哪位大神帮我看看这个环境变量为什么会报错,怎么解决

上一篇 / 下一篇  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:

 

评分:0

我来说两句

日历

« 2024-04-26  
 123456
78910111213
14151617181920
21222324252627
282930    

我的存档

数据统计

  • 访问量: 1969
  • 日志数: 5
  • 建立时间: 2016-08-09
  • 更新时间: 2016-08-16

RSS订阅

Open Toolbar