WinForm的安全上下文 [英] WinForm Security Context

查看:125
本文介绍了WinForm的安全上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个WinForms应用程序的上传地址从为preadsheet,和地缘codeS它们使用外部地理编码服务。这一切工作正常在我的本地机器,但时间已到,它要在其他人的电脑进行测试安装。这个应用程序不再起作用尽管如此,现在产生以下错误:

I have written a WinForms app that uploads addresses from a spreadsheet, and geocodes them using an external geocoding service. This all works fine on my local machine, but the time has come for it to be installed on other peoples computers for testing. The app no longer works now though, generating the below error:

 System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.

在读了很多,聊breifly到我们的网络家伙,看来我需要建立的安全上下文的用户帐户,并使用此工作,以纠正错误。

Having read a lot and chatted breifly to our network guys, it seems i need to establish the Security Context for the users account and work with this to correct the error.

有没有人有关于我应该如何去这件事?

Has anyone got any pointers about how I should be going about this?

在此先感谢!

C

推荐答案

这取决于你的上传数据。如果使用一个HTTP请求(因为它看起来像你),它看起来像;

It depends on how your uploading the data. If your using a http request (as it looks like you are) it will look something like;

  HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://test.example.com/");
  req.Method = "POST";
  req.ContentType = "text/xml";

  req.Credentials = new NetworkCredential("TESTACCOUNT", "P@ssword");

  StreamWriter writer = new StreamWriter(req.GetRequestStream());
  writer.Write(input);
  writer.Close();
  var rsp = req.GetResponse().GetResponseStream();

这篇关于WinForm的安全上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆