dim lc as long
创新互联基于成都重庆香港及美国等地区分布式IDC机房数据中心构建的电信大带宽,联通大带宽,移动大带宽,多线BGP大带宽租用,是为众多客户提供专业多线BGP机房报价,主机托管价格性价比高,为金融证券行业服务器托管,ai人工智能服务器托管提供bgp线路100M独享,G口带宽及机柜租用的专业成都idc公司。
lc=InStr(1, WebBrowser1.Document.body.innerhtml, "下载完毕!")
lc大于零的话说明包含,否则说明不包含。
简单点写。
Module Program
Sub Main()
Console.WriteLine("Hello World!")
Dim t As String, a() As String, c As Integer
t="/admin/index/login/defasd.php"
a=t.Split("/"c)
c=0
For Each p In a
If c0 Then
Console.WriteLine("/"+p)
End If
c+=1
Next
Console.Write("Press any key to continue . . . ")
Console.ReadKey(True)
End Sub
End Module
========
Hello World!
/admin
/index
/login
/defasd.php
dim st as string = "qwertyuiop"
msgbox(st.indexof("p"))
若为-1,则表示不存在
有啊,用正则表达式,下面是简单的例子
Imports System.Text.RegularExpressions
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String = "ABCDAEAFAG"
Dim Patter As String = "A"
Dim Matches As MatchCollection = Regex.Matches(str, Patter, RegexOptions.IgnoreCase Or RegexOptions.ExplicitCapture)
For Each ws In Matches
ListBox1.Items.Add("索引位置:" ws.index)
Next
End Sub
End Class
很简单,用字符串查找函数就可以实现了。
当在StrB查找到StrA字符串时,返回肯定是非0的数,值就是True,找不到为0或者-1,值就是Flase
比如:
Dim StrA As String = "Time is Limited"
Dim StrB As String = "Time"
Dim Stu As Boolean= InStr(StrA, StrB)
这运行段代码,Stu值就是True了。
我觉得这样最简单有效。