|
发表于 2013-10-3 17:37:17
|
显示全部楼层
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace test
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- HttpHelper http = new HttpHelper();
- HttpItem item = new HttpItem()
- {
- URL = "http://api.jijinhao.com/realtime/quotejs.htm?plateId=41¤tPage=1&pageSize=8&_=" + GetTime(),
- Encoding = null,
- Method = "GET",
- UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT6.0)",
- Referer = "http://www.cngold.org/img_date/tty.html",
- };
- HttpResult result = http.GetHtml(item);
- textBox1.Text = result.Html;
- }
- private string GetTime()//时间戳
- {
- DateTime timeStamp = new DateTime(1970, 1, 1);
- long a = (DateTime.UtcNow.Ticks - timeStamp.Ticks) / 10000;
- return a.ToString();
- }
- }
- }
复制代码 类正常引用就是了。 |
|