-4
        Dim adult = webClient.DownloadString("http://googleads.g.doubleclick.net/apps/domainpark/domainpark.cgi?callback=_google_json_callback&output=js&client=ca-dp-godaddy2_xml&domain_name=" + CurrentBlog.Domain)
        'ias.NavigateTillComplete("https://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain)
        Dim result = ""
        Dim url = "http://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain
        Dim webRequest = DirectCast(System.Net.HttpWebRequest.Create(url), System.Net.HttpWebRequest)
        Dim response = DirectCast(webRequest.GetResponse(), HttpWebResponse)
        Dim responseStream = response.GetResponseStream
        Dim responseString = responseStream.readAll? 'MethodAccessException doesn't exist


        Dim responseString = responseStream.readAll? 'MethodAccessException doesn't exist

どのように交換すればよい Dim responseString = responseStream.readAllですか?

実際のコマンドは何ですか?

4

1 に答える 1

1

応答ストリームをStreamReaderインスタンスに渡してから、次のReadToEndメソッドを使用できます。

Dim adult = webClient.DownloadString("http://googleads.g.doubleclick.net/apps/domainpark/domainpark.cgi?callback=_google_json_callback&output=js&client=ca-dp-godaddy2_xml&domain_name=" + CurrentBlog.Domain)
'ias.NavigateTillComplete("https://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain)
Dim result = ""
Dim url = "http://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain
Dim webRequest = DirectCast(System.Net.HttpWebRequest.Create(url), System.Net.HttpWebRequest)
Using Dim response = DirectCast(webRequest.GetResponse(), HttpWebResponse)
    Using Dim responseStream = response.GetResponseStream
        Using Dim responseReader = new StreamReader(responseStream)
            Dim responseString = responseReader.ReadToEnd()
        End Using
    End Using
End Using

しかし、WebClientを直接使用できるのに、なぜHttpWebRequestを気にする必要があるのでしょうか。

Dim adult = webClient.DownloadString("http://googleads.g.doubleclick.net/apps/domainpark/domainpark.cgi?callback=_google_json_callback&output=js&client=ca-dp-godaddy2_xml&domain_name=" + CurrentBlog.Domain)
'ias.NavigateTillComplete("https://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain)
Dim result = ""
Dim url = "http://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain
Dim responseString = webClient.DownloadString(url)
于 2013-02-24T14:16:11.043 に答える