我正在开发一款基于 .NET Framework 3.5 的手机应用程序,该应用程序使用 API 服务调用来检查网站上的电子邮件地址。我正在使用以下代码来执行此操作:
using System.Net.Http;
HttpClient webClient = new HttpClient();
webClient.QueryString.Add("email", email);
Stream stream = webClient.OpenRead(brandEndPoint);
最初我使用WebClient
而不是HttpClient
,但是我遇到了这个错误 "The type or namespace name 'WebClient' could not be found
" ,后来通过谷歌搜索并用HttpClient
修复了这个问题。
在将WebClient
替换为HttpClient
之后,我遇到了这个错误 "The type or namespace name 'Http' does not exist in the namespace 'System.Net
"。
需要帮助解决这个问题。
谢谢!