资源简介
通过子/母基金代码,从 [ 东方财富网,天天基金网,新浪 ] 抓取分级基金的子母基金数据(代码,名称,净值,价格),并计算出子基金(A基金,B基金)以及母基金的溢价率与折价率,便于投资/投机客从中套利。
数据通过网站获取,使用基金净值,非估值,一般晚间网站会更新当天基金净值,不可用于实时计算。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
namespace fundGetAndCal
{
public static class CONST
{
//获取母子基金代码
public static string fundF10Url = “http://fund.eastmoney.com/f10/jbgk_{%fundCode%}.html“;
//获取净值
public static string fundValUrl = “http://fund.eastmoney.com/{%fundCode%}.html“;
//获取价格
public static string fundPriceUrl = “http://hq.sinajs.cn/?list={%fundAllCode%}“;
//母子基金列表
public static List allFunCodeLst;
//读取完了
public static bool okFlg = false;
//状态显示文字
public static string show = “就绪“;
public static int barMax = 100;
public static int barNow = 100;
public static string GetHtml(string url Encoding encode)
{
string strBuff = ““;//定义文本字符串,用来保存下载的html
try
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
//若成功取得网页的内容,则以System.IO.Stream形式返回,若失败则产生ProtoclViolationException错 误。在此正确的做法应将以下的代码放到一个try块中处理。这里简单处理
Stream reader = webResponse.GetResponseStream();
///返回的内容是Stream形式的,所以可以利用StreamReader类获取GetResponseStream的内容,并以StreamReader类的Read方法依次读取网页源程序代码每一行的内容,直至行尾(读取的编码格式:UTF8)
StreamReader respStreamReader = new StreamReader(reader/*Encoding.UTF8*/encode);
strBuff = respStreamReader.ReadToEnd();
}
catch (Exception e)
{
Console.Write(url+“\n“+e.Message);
}
return strBuff;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 919 2015-05-30 11:27 fundGetAndCal\fundGetAndCal\App.config
文件 2138 2015-05-30 13:21 fundGetAndCal\fundGetAndCal\CONST.cs
文件 11886 2015-05-30 13:03 fundGetAndCal\fundGetAndCal\Form1.cs
文件 10777 2015-05-30 12:55 fundGetAndCal\fundGetAndCal\Form1.Designer.cs
文件 8535 2015-05-30 12:55 fundGetAndCal\fundGetAndCal\Form1.resx
文件 3814 2015-05-30 09:01 fundGetAndCal\fundGetAndCal\fundGetAndCal.csproj
文件 494 2015-05-30 08:09 fundGetAndCal\fundGetAndCal\Program.cs
文件 1346 2015-05-30 08:09 fundGetAndCal\fundGetAndCal\Properties\AssemblyInfo.cs
文件 2878 2015-05-30 08:09 fundGetAndCal\fundGetAndCal\Properties\Resources.Designer.cs
文件 5612 2015-05-30 08:09 fundGetAndCal\fundGetAndCal\Properties\Resources.resx
文件 1100 2015-05-30 08:09 fundGetAndCal\fundGetAndCal\Properties\Settings.Designer.cs
文件 249 2015-05-30 08:09 fundGetAndCal\fundGetAndCal\Properties\Settings.settings
文件 929 2015-05-30 08:11 fundGetAndCal\fundGetAndCal.sln
..A..H. 28672 2015-05-30 11:50 fundGetAndCal\fundGetAndCal.v11.suo
目录 0 2015-05-30 08:09 fundGetAndCal\fundGetAndCal\Properties
目录 0 2015-05-30 08:55 fundGetAndCal\fundGetAndCal
目录 0 2015-05-30 08:11 fundGetAndCal
文件 19968 2015-05-30 13:26 EXE\fundGetAndCal.exe
文件 165 2015-05-30 13:28 EXE\fundGetAndCal.exe.config
目录 0 2015-05-30 13:29 EXE
----------- --------- ---------- ----- ----
99482 20
相关资源
- C# IP地址输入控件
- C#在一个窗口刷新更改另一个窗口控件
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- Winform可视化打印模板设计工具含源码
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
评论
共有 条评论