Winform和MSScriptControlVBS脚本[操作系统入门]
添加完成后右击选择属性,嵌入互操作类型改成false。
ScriptControl mytool = new ScriptControl();//data和data1值由c#导入VBscriptstring code = "dim data "+ "
" + "data = " + data;
string code1 = "dim data1 " + "
" + "data1 = " + data1;
mytool.AddCode(code);
mytool.AddCode(code1);
//运行textBox1中代码
string s = textBox1.Text;
mytool.ExecuteStatement(s);
string rst = "Result";
string rst1 = "name(1)";
object result = mytool.Eval(rst); //结果查询
object result2 = mytool.Eval(rst1); //结果查询
textbox1控件中文本
VBscript脚本
dim mm,Resultdim name(1)
Result=0
mm = data
mn = data1
if mm = 1 and mn = 1 then
Result= true
else
Result= false
end if
if mn = 1 then
name(1)=true
else
name(1)=false
end if
辛苦学会怎么用,发现该脚本只适用32位平台,64位暂未找到解决方法
Winform和MSScriptControl VBS脚本
原文:https://www.cnblogs.com/dfxf/p/13631276.html
以上是 Winform和MSScriptControlVBS脚本[操作系统入门] 的全部内容, 来源链接: utcz.com/z/519327.html