资源简介
雅虎天气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详解
相关资源
- 海康视频接口调用
- 板材优化算法SDK及VC调用
- flex中调用dll,测试可用
- Linux+系统函数调用大全
- LABVIEW中调用halcon的简单说明
- GPS定位以及调用百度地图显示
- Qt建立主窗口界面控制按钮调用两个独
- fragment之间用eventbus进行传值调用方法
- Tesseract-OCR在VS2010下调用API所需要的
- 杭电操作系统实验一--linux内核编译添
- 多线程调用dll
- Delphi XE10调用微信接口
- Windows下 QT 5 调用 大华 SDK 实现摄像头
- 海康威视安卓移动端摄像头调用demo
- sdcms商业版_企业V2.3+门户V3.3+完整标签
- Arcgis GP服务调用 爆管分析
- 大华ocx插件,完美嵌入web页面,百分
- 大漠插件接口调用说明
- Web调用SignalR
- 调用系统相机拍照并压缩保存视频录
- 20110610162910c调用demo.rar
- aidl调用服务的
- Delphi XE10调用支付宝支付接口
- 在程序中调用PPT并自动播放的演示程
- 笔记本OpenCV调用摄像头进行人脸捕捉
- windows下调用openssl需要的include和lib
- 鼠标和键盘钩子Hook,实现对窗口消息
- ARCGIS 直接调用百度、天地图地图服务
- axis1实现webservice 及客户端调用方法
- linux下系统调用编程
评论
共有 条评论