赞
踩
using System;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Net;
public class weather : IHttpHandler {
///
/// 获取客户ip地址
///
///
private string GetIP()
{
string ip = HttpContext.Current.Request.ServerVariables["http_x_forwarded_for"];
if (!UserCheck.IsNotNull(ip)) ip = HttpContext.Current.Request.ServerVariables["remote_addr"];
return ip;
}
///
/// 从字符串中获取天气,温度和风力
///
/// 内容字符串
/// 是否为今天
///
private string[] Split(string str, bool IsToday)
{
string s1 = ""//风向,只有今天才有
, s2 = ""//天气,非今天
, s3 = ""//温度,非今天
, s4 = "";//风力
Regex r;
Match m;
if (IsToday)
{
r = new Regex("风向:([//s//S]+?)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
m = r.Match(str);
s1 = m.Groups[1].Value.Trim();
}
else
{
r
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。