资源简介
雅虎天气API调用
http://blog.csdn.net/a497785609/article/details/16808123

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.Regularexpressions;
using System.Threading;
using System.Windows.Forms;
using System.xml.Linq;
using Whir.Software.WeatherForecast.Library;
namespace Whir.Software.WeatherForecast
{
public partial class MainForm : Form
{
public static readonly string CityFilePath = Path.Combine(AppDomain.CurrentDomain.baseDirectory
“Data\\cities.txt“);
private readonly DataTable _table = new DataTable();
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender EventArgs e)
{
LblStatus.Text = “鼠标左键双击左侧城市,以查看天气“;
progressBar.Visible = false;
_table.Columns.Add(“iso“);
_table.Columns.Add(“name“);
_table.Columns.Add(“woeId“);
_table.Columns.Add(“longitude“);
_table.Columns.Add(“latitude“);
_table.Columns.Add(“country“);
_table.Columns.Add(“province“);
List list = FileHelper.ReadFileLines(CityFilePath);
foreach (string s in list)
{
string city = s;
Invoke(new MethodInvoker(() =>
{
var item = new ListViewItem();
item.SubItems[0].Text = city;
ListCities.Items.Add(item);
}));
DataRow row = _table.NewRow();
row[“name“] = city;
_table.Rows.Add(row);
}
}
public void SetButtonEnabled(Control container bool enabled)
{
foreach (object control in container.Controls)
{
if (((Control)control).Controls.Count > 0)
{
SetButtonEnabled((Control)control enabled);
}
else
{
if (control.GetType() == typeof(Button))
{
((Button)control).Enabled = enabled;
}
}
}
}
public void SetButtonEnabled(bool enabled)
{
SetButtonEnabled(this enabled);
}
private void BtnGetCode_Click(object sender EventArgs e)
{
if (_table != null)
{
if (_table.Rows.Count > 0)
{
var threadDelegate = new ThreadStart(delegate
{
Invoke(new MethodInvoker(() => SetButtonEnabled(false)));
DataTable tb = _table.Copy();
_table.Rows.Clear();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4603 2013-11-18 19:43 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Data\cities.txt
文件 200704 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\ICSharpCode.SharpZipLib.dll
文件 379392 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\ICSharpCode.TextEditor.dll
文件 57344 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Newtonsoft.Json.dll
文件 1624064 2013-11-18 20:39 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\NPOI.dll
文件 387072 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\NPOI.OOxm
文件 79872 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\NPOI.Openxm
文件 1316864 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\NPOI.Openxm
文件 839680 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\System.Data.SQLite.dll
文件 23552 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Whir.Software.WeatherForecast.exe
文件 16896 2013-11-19 09:13 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Whir.Software.WeatherForecast.Library.dll
文件 40448 2013-11-19 09:13 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Whir.Software.WeatherForecast.Library.pdb
文件 50688 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Whir.Software.WeatherForecast.pdb
文件 11608 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Whir.Software.WeatherForecast.vshost.exe
文件 490 2010-03-17 22:39 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\bin\Debug\Whir.Software.WeatherForecast.vshost.exe.manifest
文件 16506 2013-11-19 09:28 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\MainForm.cs
文件 14992 2013-11-19 09:28 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\MainForm.Designer.cs
文件 6190 2013-11-19 09:28 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\MainForm.resx
文件 789 2013-11-18 19:07 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 9024 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 35153 2013-11-19 09:13 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\ResolveAssemblyReference.cache
文件 5011 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\Whir.Software.WeatherForecast.csproj.FileListAbsolute.txt
文件 850 2013-11-18 21:24 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\Whir.Software.WeatherForecast.csproj.GenerateResource.Cache
文件 40853 2013-11-18 20:51 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\Whir.Software.WeatherForecast.csprojResolveAssemblyReference.cache
文件 23552 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\Whir.Software.WeatherForecast.exe
文件 180 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\Whir.Software.WeatherForecast.MainForm.resources
文件 50688 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\Whir.Software.WeatherForecast.pdb
文件 180 2013-11-19 09:29 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\obj\x86\Debug\Whir.Software.WeatherForecast.Properties.Resources.resources
文件 513 2013-11-18 19:23 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\Program.cs
文件 1408 2013-11-18 19:06 15.Whir.Software.WeatherForecast\Whir.Software.WeatherForecast\Properties\AssemblyInfo.cs
............此处省略281个文件信息
- 上一篇:struts2实现服务器端校验
- 下一篇:ShaderGraph详解
相关资源
- WinCE中的Web Service调用
- Winform调用系统的剪切,复制,粘贴文
- hibernate调用存储过程
- 调用WOSA/XFS的简单示例
- 进程的管道通信编制一段程序,实现
- 一个可以由SVCHost.exe服务调用的dll模块
- pb9调用良田高拍仪例程scanctrl1.0
- 200SMART Modbus-TCP通信程序演示-轮询(多
- PB9.0调用MD5加密
- birt调用存储过程.doc
- 让程序禁止结束进程并提示拒绝访问
- BIOS中断调用表
- Delphi7调用虹软人脸识别的测试
- 网页调用ActiveX控件获取串口数据
- 匿名设备标识符OAID调用 SDK版本号 o
- unity3d调用中央气象局城市天气数据,
- web调用本地应用程序exe
- 第三方调用U9服务说明(DotNet平台)
- 通过NodeJS中的http.get() 和 http.requ
- .net 调用摄像头代码
- 管道风格、黑板风格、调用/返回风格
- ARCGIS直接调用百度、天地图地图服务
- 蚁群算法模型美赛B题C问,可直接调用
- VS2013生成并调用DLL的封装教程内和教
- 调用百度地图API实现实时定位案例
- 广东省各市区无街道地图SVG可接入程
- Dll调用与嵌套调用
- 调用百度地图
- SAP PI配置流程完整版ecc端发布RFC服务
- VFP通用报表调用打印程序.rar
评论
共有 条评论