WebClient in Windows Service
来源:互联网 发布:tensorflow reuse 编辑:程序博客网 时间:2024/05/29 02:05
前提:
1.如果你访问网络需要使用代理
2.如果你控制台程序使用WebClient访问或下载文件时正常,但作为Windows Service使用 WebClient 时失败。其中报错包括但不限于:操作超时(The operation has timed out) / 无法连接到远程服务器(Unable to connect to the remote server)
请尝试在代码中定义代理地址:
var client = new WebClient(); if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["WebProxyUri"])) { IWebProxy proxyObject = new WebProxy(System.Configuration.ConfigurationManager.AppSettings["WebProxyUri"], true, new[] { @"172.*" }); client.Proxy = proxyObject; }
- WebClient in Windows Service
- Simple Windows Service in C++
- Push Notification Service in Windows phone
- Self install windows service in .NET c#
- Config windows Service Name in App.config
- Hosting WCF Service with netTcpBinding in Windows Service
- webclient
- webclient
- WebClient
- Windows Phone开发之 WebClient 讲解
- Windows Phone开发之WebClient的用法
- install redis service as windows service in windows platform--在windows平台下以windows服务方式安装redis
- [From Network]Creating a Windows Service in C# (2)
- Host a Remote Object in a Windows Service
- Remote Installation Service (RIS) in Windows Server 2003
- Hosting WCF Services in Windows Activation Service {转载}
- How to create (and deploy) a windows service in C# ?
- IP Watchdog: Simple Windows Service Written in C#
- 什么是QS认证?
- linux截图工具的使用
- 定位页面元素
- 一个跨浏览器事件检查的反思
- 10 个基于 JavaScript 的图表插件推荐
- WebClient in Windows Service
- C++静态成员的初始化问题,导致定义的静态成员 unresolved
- “function”未定义;假设外部返回 int
- shell转换时间格式
- 千姿百态项目经理3——“牛X”项目经理1
- VS2008打开解决方案后自动关闭
- 开启Mac OS X系统Root用户权限
- 【学习点滴-数据结构-二叉树】判断二叉树是否是平衡二叉树
- Linux 搭建svn服务器+ssh访问