我有以下代码:
public class Request
{
static string username = "ha@gmail.com";
public string Send()
{
///some variables
try
{
///
}
catch (WebException e)
{
using (WebResponse response = e.Response)
{
HttpWebResponse httpResponse = (HttpWebResponse)response;
Console.WriteLine("Error code: {0}", httpResponse.StatusCode);
using (Stream Data = response.GetResponseStream())
{
string text = new StreamReader(Data).ReadToEnd();
}
}
}
return text;
}
}
出现错误:当前上下文中不存在“文本”。如何从方法中返回“文本”值。