初级问题?谢谢了

WANGGUOLAI 2008-01-30 07:27:58
我在开发一个关于ppc上网抓数据的程序,不知道从何下手,请各位指点!
有没有什么demo啊?
...全文
61 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
WANGGUOLAI 2008-01-31
  • 打赏
  • 举报
回复
谢谢,LZ几位
有没有VC++的demo啊?
mtm026 2008-01-31
  • 打赏
  • 举报
回复
using System;
using System.Data;
using System.IO;
using System.Configuration;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// webrequest 的摘要说明
/// </summary>
public class webRequest
{
public webRequest()
{
//
// TODO: 在此处添加构造函数逻辑
//
}

public string GetHtmlText(string url)
{
string html = null;
try
{
HttpWebRequest theRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse theResponse = (HttpWebResponse)theRequest.GetResponse();
Stream stream = theResponse.GetResponseStream();
StreamReader readerOfStream = new StreamReader(stream, Encoding.Default);
html = readerOfStream.ReadToEnd();
theResponse.Close();
stream.Close();
readerOfStream.Close();
}
catch
{
html = "";
}
return html;
}

public string CutStr(string html, string start, string end)
{
int a = html.IndexOf(start) + start.Length;
int b = html.IndexOf(end, a) - a;
return html.Substring(a, b);
}
}
ht_qq0609 2008-01-31
  • 打赏
  • 举报
回复
哈哈,什么抓数据。还有人说扒数据。其实就是打开网页的程序,然后对下载的网页分析。例子很多啊。在网上搜搜下载网页的例子就可以了。
guguqiaqia 2008-01-31
  • 打赏
  • 举报
回复
网抓数据 ?是得到网页信息吗?

新名词,帮你顶。

7,655

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧