System.Net.WebClient fails weirdly

前端 未结 4 859
梦谈多话
梦谈多话 2021-02-19 18:29

I am trying to download some data from the reporting services instance on our TFS server.
Given that the code should run on a computer that is not domain-joined, I figured t

4条回答
  •  说谎
    说谎 (楼主)
    2021-02-19 19:06

    Try this ...

    var credCache = new CredentialCache();
    credCache.Add(new Uri("http://teamfoundationserver/reports/........""),
                          "Basic", 
                          new NetworkCredential("username", "password", "DOMAIN"));
    wc.Credentials = credCache;
    

    If that does not work, try replacing "Basic" with "Negotiate".

提交回复
热议问题