抓数据
来源:互联网 发布:2016全球碳排放量数据 编辑:程序博客网 时间:2024/05/17 09:37
做过股票的人都知道要选一个好股票往往要用到技术指标选股,而有时自己会有一些想法,想用其来挑选股票,并用历史数据进行校验,必须要有每日的数据,下面是我自己写的一个抓数据的C#代码。
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 股票技术分析
{
public partial class Form3 : Form
{
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["BusinessConnString"].ConnectionString;
string stockcode = "";
DataTable dt;
int Count = 0;
string beginday;
string endday;
public Form3()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{
DataSet ds = Platform.Data.SqlHelper.ExecuteDataset(conn, CommandType.Text, "select * from StockCodeInformation where IsActive=0 order by stockcode");
dt = ds.Tables[0];
stockcode = dt.Rows[0]["stockcode"].ToString();
beginday = (1991 ).ToString() + "-01-01";
endday = (1991 ).ToString() + "-12-31";
webBrowser1.Url = new Uri(@"http://app.finance.ifeng.com/hq/stock_daily.php?code=" + stockcode + "&begin_day=" + beginday + "&end_day=" + endday);
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string sql = "update StockCodeInformation set IsActive=1 where stockcode = '" + stockcode + "'";
Platform.Data.SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql);
if (Count < dt.Rows.Count)
{
Count++;
stockcode = dt.Rows[Count]["stockcode"].ToString();
webBrowser1.Url = new Uri(@"http://app.finance.ifeng.com/hq/stock_daily.php?code=" + stockcode + "&begin_day=" + beginday + "&end_day=" + endday);
}
}
}
}
- 抓数据
- oprofile抓不到数据
- TCPDUMP数据抓包
- wireshark抓回环数据
- Yiban抓数据小结
- aauto抓http数据
- 数据 抓包工具
- 抓iphone数据
- 数据抓包+hijson
- BurpSuite抓HTTPS数据
- Paros数据抓包
- 爬虫数据抓包
- OPC客户端抓数据
- node.js抓url数据
- android 网络数据抓包
- android 网络数据抓包
- fiddler抓包数据分析
- 手机数据抓包入门教程
- C细节
- 数据库SQL分页
- HSDPA
- php note
- 异常处理----------让缺陷掌握在自己手中
- 抓数据
- Resin 管理员默认账号登陆密码
- mysql_connect和mysql_pconnect区别
- first blood
- 在AIX5.3系统上安装oracle9i和weblogic
- 4G
- c语言如何先写文件体,再写文件头
- 穷人缺什么:表面缺资金,本质缺野心,脑子缺观念,机会缺了解,骨子缺勇气,改变缺行动,事业缺毅力
- GDB调试精粹及使用实例