你有一些选择:
您可以将字节数组转换为字符串,找到替换。
您可以创建一个DOM对象,将字节数组转换为字符串,加载它并将该值附加到需要的属性处(基本上,您正在查找没有http:或https:in的任何src,href属性它)。
Console.Write(ControlChars.Cr + "Please enter a Url(for example, http://www.msn.com): ")
Dim remoteUrl As String = Console.ReadLine()
Dim myWebClient As New WebClient()
Console.WriteLine(("Downloading " + remoteUrl))
Dim myDatabuffer As Byte() = myWebClient.DownloadData(remoteUrl)
Dim download As String = Encoding.ASCII.GetString(myDataBuffer)
download.Replace("src=""/", "src=""" & remoteUrl & "/")
download.Replace("href=""/", "href=""" & remoteUrl & "/")
Console.WriteLine(download)
Console.WriteLine("Download successful.")