相关疑难解决方法(0)

407需要验证 - 未发送任何挑战

更新:
如果你刚刚得到这个问题,一般的要点是我正在尝试通过代理进行HttpWebRequest,我从我们奇怪的代理服务器获得407.IE,Firefox,Chrome都能成功地协商代理,Adobe Air应用程序也是如此.Google Chrome网络安装程序实际上失败并且我们必须使用脱机安装程序可能很重要.

感谢Ian的链接,我已经让它进入​​下一阶段.它现在将令牌发送回代理,但是第3阶段没有通过,因此具有用户名/密码哈希的请求不是由.NET发送的,因此不返回HTML.

我在用:

  • IE6用户代理
  • Windows 7的
  • 扫描安全代理
  • .NET 3.5

这是最新的代码,相当于下面的日志:

HttpWebRequest request = HttpWebRequest.Create("http://www.yahoo.com") as HttpWebRequest;
IWebProxy proxy = request.Proxy;
// Print the Proxy Url to the console.
if (proxy != null)
{
    // Use the default credentials of the logged on user.
    proxy.Credentials = CredentialCache.DefaultCredentials;
}
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)";
request.Accept = "*/*";

HttpWebResponse response = request.GetResponse() as HttpWebResponse;
Stream stream = response.GetResponseStream();
Run Code Online (Sandbox Code Playgroud)

例外

WebException(407)需要身份验证.

正在使用的代理

代理客户端是我们服务器机房中的一个Scansafe …

c# proxy httpwebrequest http-status-code-407

8
推荐指数
2
解决办法
3万
查看次数

在Azure角色中使用SmtpClient时,"不支持请求的功能"异常

我在Azure Web或Worker角色中使用SmtpClient时遇到异常.

我创建了一个控制台应用程序,通过RDP在角色VM上手动运行以重现:

using System;
using System.Net;
using System.Net.Mail;
using System.Text;

namespace ConsoleApplication1
{
   class Program
   {
      static void Main()
      {
         var mailClient = new SmtpClient("mail.redacted.com", 587);
         mailClient.EnableSsl = true;
         mailClient.DeliveryFormat = SmtpDeliveryFormat.International;
         mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;

         mailClient.UseDefaultCredentials = false;//SET THIS FIRST OR IT WIPES OUT CREDENTIALS
         NetworkCredential netCreds = new NetworkCredential("mail@redacted.com", "12345 same combination on my luggage");
         mailClient.Credentials = netCreds;

         MailMessage message = new MailMessage();
         message.SubjectEncoding = Encoding.UTF8;
         message.BodyEncoding = Encoding.UTF8;
         message.IsBodyHtml = false;

         message.From = new MailAddress("mike@redacted.com");
         message.To.Add(new MailAddress("mike@redacted.com")); …
Run Code Online (Sandbox Code Playgroud)

.net c# azure smtpclient

7
推荐指数
1
解决办法
4530
查看次数