怎么判断域名是顶级域名啊
本帖最后由 qwee7117 于 2013-08-01 21:28:56 编辑 ie地址是http://www.163.com/
chrome地址是www.163.com
ie地址http://www.163.com/abc.123.html
chrome地址是www.163.com/abc.123.html
vb代码
If chromeurl.Text Like "*com/*" Then
Text2.Text = "http://" + Text2.Text
Else
Text2.Text = "http://" + Text2.Text + "/"
If chromeurl.Text Like "*cn/*" Then
Text2.Text = "http://" + Text2.Text
Else
Text2.Text = "http://" + Text2.Text + "/"
End If
Private Sub Command1_Click()
Const TOPURLSUFF As String = "com
[解决办法]
net
[解决办法]
org
[解决办法]
edu
[解决办法]
gov
[解决办法]
cn
[解决办法]
hk
[解决办法]
us
[解决办法]
eu
[解决办法]
cc"
' 其它的国家域名自己照这个格式添加
Dim strChmURL As String
Dim i&, strTemp$
strChmURL = chromeurl.Text
strTemp = LCase$(Mid$(strChmURL, InStrRev(strChmURL, ".") + 1))
i = InStr(TOPURLSUFF, strTemp) - 1
If (i And 3) Then
strTemp = "http://" & Text2.Text
Else
strTemp = "http://" & Text2.Text & "/"
End If
End Sub