c#的函数翻译成vb.net的语句,快快 在线等
privatestaticstring[]GetLinks(stringhtml){conststringpattern=@"http://([\w-]+\.)+[\w-...
private static string[] GetLinks(string html)
{
const string pattern = @"http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
Regex r = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection m = r.Matches(html);
string[] links = new string[m.Count];
for (int i = 0; i < m.Count; i++)
{
links[i] = m[i].ToString();
}
return links;
} 展开
{
const string pattern = @"http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
Regex r = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection m = r.Matches(html);
string[] links = new string[m.Count];
for (int i = 0; i < m.Count; i++)
{
links[i] = m[i].ToString();
}
return links;
} 展开
1个回答
展开全部
Private Static Function GetLinks(ByVal html As String) As String()
Const pattern As String = "http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
Dim r As Regex = New Regex(pattern, RegexOptions.IgnoreCase)
Dim links As String()
ReDim links(m.Count)
For i As Integer = 0 To m.Count - 1
links(i) = m(i).ToString()
Next
Return links
End Function
Const pattern As String = "http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
Dim r As Regex = New Regex(pattern, RegexOptions.IgnoreCase)
Dim links As String()
ReDim links(m.Count)
For i As Integer = 0 To m.Count - 1
links(i) = m(i).ToString()
Next
Return links
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询