求一个c#做的winform 小程序
- 提问者网友:欺烟
- 2021-01-26 12:55
我想参考一下。
谢谢!(基础的题目就好,写好答案)
绝对追+高分,绝不骗人
邮箱756791021@qq.com
我在等等有没谁有题了,你的不错;谢了;没题的话这些分都给你再追+你10分
- 五星知识达人网友:十鸦
- 2021-01-26 14:25
很有代表性哦。
我已经发到你的Email。资料都在附件的EXAM2.RAR压缩包里,你专心研究吧!
- 1楼网友:忘川信使
- 2021-01-26 17:16
- 2楼网友:煞尾
- 2021-01-26 16:53
- 3楼网友:玩世
- 2021-01-26 15:53
string filename = system.configuration.configurationmanager.appsettings["filename"]; string url = system.configuration.configurationmanager.appsettings["url"];
//编码 encoding encode = encoding.getencoding("utf-8"); //请求url httpwebrequest req = (httpwebrequest)webrequest.create(url);
httpwebresponse rep = (httpwebresponse)req.getresponse(); //创建streamreader与streamwriter文件流对象 streamreader sr = new streamreader(rep.getresponsestream(), encode); streamwriter sw = new streamwriter(filename, false, encode); //写入内容 sw.write(sr.readtoend()); //清理当前缓存区,并将缓存写入文件 sw.flush(); //释放相关对象资源 sw.close(); sw.dispose(); sr.close(); sr.dispose();
config 配置
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key="filename" value="e:\weather.html"/> <add key="url" value=" http://www.weather.com.cn/weather/101210101.shtml"/> <add key="timer" value="5000"/> </appsettings>
</configuration>
- 4楼网友:十年萤火照君眠
- 2021-01-26 14:41