缺少语句是什么意思
Dim EnvironmentPathEnvironmentPath="D:\Envlib.xml"
call createEnviormentXML(EnvironmentPath)
environment.LoadFromFile EnvironmentPath
URL=Environment.Value("netUrl")
systemutil.Run Url
Function createEnviormentXML(xmlpath)
Set fso=createObject("Scripting.FileSystemObject")
Set oXml=fso.CreateTextFile(xmlPath)
oxml.Write_
"<Environment>"+vbCrlf+"<Variable>"+vbCrlf+_
"<Name>netname</Name>"+vbCrlf+_
"<Value>baidu</Value>"+vbCrlf+_
"</Variable>"+vbCrlf+_
"</Variable>"+vbCrlf+_
"<Name>netname</Name>"+vbCrlf+_
"<Value>http://www.baidu.com</Value>"+vbCrlf+_
"</Variable>"+vbCrlf+_
"<Environment>"
Set oxml=nothing
Set fso=nothing
End Function
就是这句代码总是报错
"<Environment>"+vbCrlf+"<Variable>"+vbCrlf+_
提示为:
缺少语句
Line (12): ""<Environment>"+vbCrlf+"<Variable>"+vbCrlf+_".
缺少语句什么意思?请各位大神帮忙分析一下,谢谢
oxml.Write后面加个空格 puchonghui 发表于 2016-8-12 08:10
oxml.Write后面加个空格
确实解决了,但是又产生另一个问题,Envlib.xml已经创建了,但是现在的错误是以下
File "D:\Envlib.xml" could not be parsed.
Line (4): "Environment.LoadFromFile EnvironmentPath".
这又是什么意思呢? 鱿鱼丝 发表于 2016-8-12 21:47
确实解决了,但是又产生另一个问题,Envlib.xml已经创建了,但是现在的错误是以下
File "D:\Envlib.xm ...
XML的格式错了, "<Variable>"+vbCrlf+_
"<Name>netname</Name>"+vbCrlf+_
"<Value>http://www.baidu.com</Value>"+vbCrlf+_
"</Variable>"+vbCrlf+_
"</Environment>"
页:
[1]