【问题标题】:Use a string as an argument in StringReader在 StringReader 中使用字符串作为参数
【发布时间】:2017-11-13 09:17:17
【问题描述】:

我在Wonderware Archestra IDE 中使用带有.NET 的脚本。这工作正常:

dim SR as System.IO.StringReader;
SR = new System.IO.StringReader(OPCClient_L09.Valve.AliasDatabase);

但我需要这样,但它不起作用:

dim SR as System.IO.StringReader;
dim Input as String;
Input = "OPCClient_L09.Valve.AliasDatabase";
SR = new System.IO.StringReader(Input);

【问题讨论】:

    标签: wonderware


    【解决方案1】:

    您已经声明了一个字符串类型,即 Wonderware 字符串类型。 StringReader 需要一个 System.String(即 .NET 类型)。

    将您的字符串声明更改为 System.String:

    dim SR as System.IO.StringReader;
    dim Input as System.String;
    Input = "OPCClient_L09.Valve.AliasDatabase";
    SR = new System.IO.StringReader(Input);
    

    【讨论】:

      猜你喜欢
      • 2019-02-02
      • 1970-01-01
      • 1970-01-01
      • 2013-07-19
      • 1970-01-01
      • 2021-08-10
      • 2011-12-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多