在此上下文中无法访问System.Data.Operators',因为它是“朋友”

时间:2015-01-24 18:53:38

标签: vb.net

请帮助解决这个问题。 对于前4个是错误“'System.Data.Operators'在此上下文中无法访问,因为它是'Friend'。”

    bool1 = (Operators.CompareString = Me.url) "http://HIDDENLINK/WiHome", False) = 0)

    bool1 = (Operators.CompareString(Me.url, "https://HIDDENLINK/ProfilesGate?nextpage=http%3A%2F%2FHIDDENLINK%2FDefault", False) = 0)

    bool1 = (Operators.CompareString(Me.url, "https://HIDDENLINK.com/ProfilesGate?nextpage=http://HIDDENLINK/Default", False) = 0)

bool1 = (Operators.CompareString(Me.url, "https://HIDDENLINK/home?locale=en-US", False) = 0)

1 个答案:

答案 0 :(得分:0)

我不确定你为什么连续4次写同一个布尔变量但你可以用两种方法之一做这个。最后的False部分允许您指定字符串是否应与特定情况进行比较。正如您在示例中所述,False部分指定字符串必须完全相同,使用相同的小写和大写字符:

bool1 = String.Compare(Me.url, "http://HIDDENLINK/WiHome", False) = 0

bool1 = String.Compare(Me.url, "https://HIDDENLINK/ProfilesGate?nextpage=http%3A%2F%2FHIDDENLINK%2FDefault", False) = 0

bool1 = String.Compare(Me.url, "https://HIDDENLINK.com/ProfilesGate?nextpage=http://HIDDENLINK/Default", False) = 0

bool1 = String.Compare(Me.url, "https://HIDDENLINK/home?locale=en-US", False) = 0

或者,如果您知道要比较与案例完全匹配的字符串,则这是另一种方法:

bool1 = Me.url = "http://HIDDENLINK/WiHome"

bool1 = Me.url = "https://HIDDENLINK/ProfilesGate?nextpage=http%3A%2F%2FHIDDENLINK%2FDefault"

bool1 = Me.url = "https://HIDDENLINK.com/ProfilesGate?nextpage=http://HIDDENLINK/Default"

bool1 = Me.url = "https://HIDDENLINK/home?locale=en-US"