广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 139773 个阅读者
 
<<   1   2  下页 >>(共 2 页)
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
啊条o
个人文章 个人相簿 个人日记 个人地图
路人甲
级别: 路人甲 该用户目前不上站
推文 x4 鲜花 x75
分享: 转寄此文章 Facebook Plurk Twitter 版主评分 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x1
[Basic][范例] 【原创】用VB6撰写的"无名好友抓取"程式
程式名称 : GetWretchFriends

程式介绍 :

这程式能抓无名帐号里的好友,并且显示 共有几个好友 !!!

编写语言 : vb6.0

[此文章售价 1 雅币已有 33 人购买]
若发现会员采用欺骗的方法获取财富,请立刻举报,我们会对会员处以2-N倍的罚金,严重者封掉ID!


此文章被评分,最近评分记录
财富:50 (by ebolaman) | 理由: 实用的程式, Keep it up!! ^^


献花 x3 回到顶端 [楼 主] From:台湾中华电信股份有限公司 | Posted:2011-08-30 20:44 |
aa 手机 会员卡 葫芦墩家族
个人文章 个人相簿 个人日记 个人地图 个人商品
特殊贡献奖 社区建设奖
头衔:            
站长
级别: 站长 该用户目前不上站
推文 x1964 鲜花 x5260
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

不错哦...

用无名的朋友有福了.. 表情


献花 x0 回到顶端 [1 楼] From:台湾新世纪资通股份有限公司 | Posted:2011-08-31 07:47 |
ebolaman 手机 会员卡
个人文章 个人相簿 个人日记 个人地图
特殊贡献奖

级别: 副版主 该用户目前不上站
版区: 程式设计
推文 x38 鲜花 x458
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

这似乎是用 WebBrowser 的 HTML 去解析的

下次你可以试试看用 Inet 来取得网页的 HTML原始码,速度会更快哦!


因为 WebBrowser 除了取得 HTML原始码,还必须取得 图片、内嵌物件等东西

万一那个网页刚好内嵌东西一堆,取得的时间会非常久,但是单纯取得 HTML码 再来解析就不会碰上这种问题


My BOINC stats :

献花 x0 回到顶端 [2 楼] From:台湾宽频通讯顾问股份有限公司 | Posted:2011-08-31 12:34 |
三仙 会员卡
个人头像
个人文章 个人相簿 个人日记 个人地图
头衔:以马内利 以马内利
版主
级别: 版主 该用户目前不上站
版区: 程式设计
推文 x17 鲜花 x370
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

下面是引用 ebolaman 于 2011-08-31 12:34 发表的 : 到引言文
这似乎是用 WebBrowser 的 HTML 去解析的

下次你可以试试看用 Inet 来取得网页的 HTML原始码,速度会更快哦!


因为 WebBrowser 除了取得 HTML原始码,还必须取得 图片、内嵌物件等东西

万一那个网页刚好内嵌东西一堆,取得的时间会非常久,但是单纯取得 HTML码 再来解析就不会碰上这种问题


如果程式不须要出现网页画面
我也不建议用WebBrowser  去捞资料
给你 MSDN 参考资料  Using the Internet Transfer Control 


挖出答案的难度,取决提问的深度!
献花 x1 回到顶端 [3 楼] From:台湾中华电信股份有限公司 | Posted:2011-08-31 20:57 |
啊条o
个人文章 个人相簿 个人日记 个人地图
路人甲
级别: 路人甲 该用户目前不上站
推文 x4 鲜花 x75
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

下面是引用 三仙 于 2011-08-31 20:57 发表的 : 到引言文
 

如果程式不须要出现网页画面
我也不建议用WebBrowser  去捞资料
给你 MSDN 参考资料  Using the Internet Transfer Control 


话说  有人知道为何我都进不去msdn网站吗= = 


献花 x0 回到顶端 [4 楼] From:台湾中华电信股份有限公司 | Posted:2011-08-31 21:06 |
ebolaman 手机 会员卡
个人文章 个人相簿 个人日记 个人地图
特殊贡献奖

级别: 副版主 该用户目前不上站
版区: 程式设计
推文 x38 鲜花 x458
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

MSDN 的内容大概是这样 :

Dim s_URL As String
Dim bData() As Byte  
Dim f As Integer

s_URL = "ftp://ftp.microsoft.com/So...b.exe"
f = FreeFile()
bData() = Inet1.OpenURL(s_URL, icByteArray)
Open "C:\Temp\Softlib.exe" For Binary Access Write As #f
Put #f, , bData()
Close #f

接着再把档案读取就能获得 HTML 码接着解析


用法大概就是这样

参考 http://tw.knowledge.yahoo.com/quest...d=1008122710962


My BOINC stats :

献花 x1 回到顶端 [5 楼] From:台湾宽频通讯顾问股份有限公司 | Posted:2011-08-31 21:58 |
三仙 会员卡
个人头像
个人文章 个人相簿 个人日记 个人地图
头衔:以马内利 以马内利
版主
级别: 版主 该用户目前不上站
版区: 程式设计
推文 x17 鲜花 x370
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

下面是引用 啊条o 于 2011-08-31 21:06 发表的 : 到引言文

话说  有人知道为何我都进不去msdn网站吗= = 


这是网站里的资料 转PO 给你看
Visual Basic Concepts
Visual Studio 6.0 Using the Internet Transfer Control

The Internet Transfer control implements two widely-used Internet protocols: the HyperText Transfer Protocol (HTTP) and the File Transfer Protocol (FTP). Using the Internet Transfer control, you can connect to any site that uses one of these protocols, and retrieve files using either the OpenURL or Execute method.
Possible Uses
  • To add an FTP browser to any application.

  • To create an application that automatically downloads files from a public FTP site.

  • To parse a World Wide Web site for graphics references and download the graphics only.

  • To present a custom display of dynamic data retrieved from a Web page.
Basic Operation
The functionality of the Internet Transfer control depends on the protocol you wish to use. Because the two supported protocols work differently, the operations you can perform depend on which protocol you are using. For example, the GetHeader method only works with HTTP (HTML documents).
However, there are a few procedures that are common to both protocols. Basically, in order to use either protocol, you must:
  1. Set the AccessType property to a valid proxy server.

  2. Invoke the OpenURL method with a valid URL.

  3. Invoke the Execute method with a valid URL and command appropriate to the protocol.

  4. Use the GetChunk method to retrieve data from the buffer.
Setting the AccessType Property: Using a Proxy Server
In order to make any kind of connection to the Internet, you must determine how your computer is connected to the Internet. If you are on an intranet, you will probably be connected to the Internet via a proxy server.
In short, a proxy server is an intermediary between your computer and the Internet. All computers on an intranet that need to connect to the Internet must do so through a proxy server. Thus the proxy functions as a firewall between the intranet and the Internet, discarding invalid end-user and external requests, thereby protecting the intranet from hostile actions.
To find the proxy settings on your computer
Note   The following steps apply only to Windows 95, Windows NT® 4.0, or later systems.
  1. On the Taskbar of your computer, click Start.

  2. On the Settings item, click the Control Panel.

  3. Double-click the Internet icon.

  4. On the Internet Properties dialog box, click Connection.

  5. Under Proxy Server, confirm that the Connect Through a Proxy Server check box is selected.

  6. If it is selected, click Settings. The name of proxy servers you use for various protocols will be found in the dialog box. If no proxy is defined, contact your system administrator for available proxy servers.
If you intend to use a proxy other than that named in the dialog box, set the AccessType property to icNamedProxy (2). Then set the Proxy property to the name of the proxy, as shown in the code below:
[pre]Inet1.Proxy = "myProxyName"Inet1.AccessType = icNamedProxy[/pre]On the other hand, if you are content to use the default proxy (as determined by your computer's registry), ignore the Proxy property, and simply set the AccessType to icUseDefault (0).
The settings for AccessType are shown in the following table:

Invoke the OpenURL Method
After you set the AccessType property, the most basic operation is to use the OpenURL method with a valid URL. When you use the OpenURL method, the result will depend on the target URL. For example, the following URL will return the HTML document found at www.microsoft.com:
[pre]' A TextBox control named Text1 contains the' result of the method. The Internet Transfer' control is named Inet1.Text1.Text = Inet1.OpenURL("http://www.micros...")[/pre]As a result, the TextBox control is filled with the HTML source, which may resemble the figure below:

In this case, the default action was to return the HTML document located at the URL. However, if the URL is modified to target a specific text file, the actual file would be retrieved. For example, the following code:
[pre]Text1.Text = Inet1. _OpenURL("ftp://ftp.microsoft.com/....txt")[/pre]would result in the actual text of the file, as shown below:

Tip   When you use either the OpenURL or Execute method, you need not set the Protocol property. The Internet Transfer control will automatically set itself to the correct protocol, as determined by the protocol portion of the URL.
Finally, you can use the OpenURL method with a URL that includes appended data. For example, many Web sites offer the ability to search a database. To search, send a URL that includes the search criteria. For example, the following code would use a search engine named "search.exe" with the criteria "find=Maui."
[pre]Dim strURL As StringstrURL = _"http://www.megaphone43.com/cgi-bin/...=mauiText1.Text = Inet1.OpenURL(strURL)[/pre]If the search engine finds a match for the criteria, an HTML document would be assembled and returned with the appropriate information.
Saving to a File Using the OpenURL Method
If you wish to save the data retrieved through the OpenURL method to a file, use the Open, Put, and Close statements, as shown in the code below. This example streams a binary file into a Byte array before saving the data to disk:
[pre]Dim strURL As StringDim bData() As Byte     ' Data variableDim intFile As Integer   ' FreeFile variablestrURL = _"ftp://ftp.microsoft.com/Softli..."intFile = FreeFile()     ' Set intFile to an unused                 ' file.' The result of the OpenURL method goes into the Byte' array, and the Byte array is then saved to disk.bData() = Inet1.OpenURL(strURL, icByteArray)Open "C:\Temp\Softlib.exe" For Binary Access Write _As #intFilePut #intFile, , bData()Close #intFile[/pre]A similar procedure can be used to write a text file to disk, except no Byte array is needed; the data is saved directly to the file:
[pre]Dim strURL As String     ' URL stringDim intFile As Integer   ' FreeFile variableIntFile = FreeFile()strURL = "http://www.microsof...ot;Open "c:\temp\MSsource.txt" For Output _As #IntFileWrite #IntFile, Inet1.OpenURL(strURL)Close #IntFile[/pre]Synchronous and Asynchronous Transmission
The OpenURL method results in a synchronous transmission of data. In this context, synchronous means that the transfer operation occurs before any other procedures are executed. Thus the data transfer must be completed before any other code can be executed.
On the other hand, the Execute method results in an asynchronous transmission. When the Execute method is invoked, the transfer operation occurs independently of other procedures. Thus, after invoking the Execute method, other code can execute while data is received in the background.
What does this mean for the user of the Internet Transfer control? In short, using the OpenURL method results in a direct stream of data that you can save to disk (as shown above), or view directly in a TextBox control (if the data was text). On the other hand, if you use the Execute method to retrieve data, you must monitor the control's connection state using the StateChanged event. When the appropriate state is reached, invoke the GetChunk method to retrieve data from the control's buffer. This operation is discussed in greater detail below.
Using the Execute Method with the FTP Protocol
The Execute method has four arguments: url, operation, data, and requestHeaders. FTP operations take only the operation argument and the url argument, which is optional. For example, to get a file from a remote computer, you could use the following code:
[pre]Inet1.Execute "FTP://ftp.microso...quot;, _"GET disclaimer.txt C:\Temp\Disclaimer.txt"[/pre]If you are used to using FTP to retrieve files from anonymous FTP servers, you will be familiar with certain commands used to navigate through server trees, and to retrieve files to a local hard disk. For example, to change directory with the FTP protocol, you would use the command "CD" with the path of the directory you wish to change to.
For the most common operations, such as putting a file on a server and retrieving a file from a server, the Internet Transfer control uses the same or a similar command with the Execute method. For example, the following code uses the "CD" command as an argument of the Execute method to change directory:
[pre]' The txtURL textbox contains the path to open. The' txtRemotePath textbox contains the path to change to.Inet1.Execute txtURL.Text, "CD " & txtRemotePath.Text[/pre]Note   When using the Execute method with FTP commands, the data and requestHeaders arguments are not used. Instead, all of the operations and their parameters are passed as a single string in the operation argument; parameters are separated by a space. In the descriptions below, do not confuse the terms "file1" and "file2" with the data and requestHeaders arguments.
The syntax for FTP operations is:
operationName file1 file2
For example, to get a file, the following code includes the operation name ("GET"), and the two file names required by the operation:
[pre]' Get the file named Disclaimer.txt and copy it to the' location C:\Temp\Disclaimer.txtInet1.Execute, _"GET Disclaimer.txt C:\Temp\Disclaimer.txt"[/pre]The following table lists the supported FTP commands of the control:

Important   If your proxy server is a CERN proxy server, direct FTP connections (using the Execute method) are disallowed. In that case, to get a file, use the OpenURL method with the Open, Put, and Close statements, as shown earlier in "Saving to a File Using the OpenURL Method." You can also use the OpenURL method to get a directory listing by invoking the method and specifying the target directory as the URL.
Using the Execute Method with the HTTP Protocol
The HTTP protocol allows client machines to request data from the server using the GET, HEAD, POST, and PUT commands. These operations are shown in the following table:

The Common Gateway Interface and the Execute Method
Many World Wide Web sites offer the ability to search a database. This is accomplished by using the HTTP protocol's ability to send queries using the Common Gateway Interface (CGI).
It is not in the scope of this topic to explain the CGI; however, if you are familiar with the CGI, you can use the Execute method to construct an application that simulates the behavior of World Wide Web sites. For example, the code below shows a typical CGI query string:
[pre]http://www.findThis2490.com/cgi-bin/find.exe?find=Hangzhou[/pre]This same query could be sent using the Execute method as shown below:
[pre]Dim strURL As String, strFormData As StringstrURL = "//www.findThis2490.com/cgi-bin/find.exe"strFormData = "find=Hangzhou"Inet1.Execute strURL, "POST", strFormData[/pre]If you are expecting a result back from a server (as in the example above), you must use the GetChunk method to retrieve the resulting HTML document.
Using the State Event with the GetChunk Method
When you are downloading data from a remote computer, an asynchronous connection will be made. For example, using the Execute method with the operation "GET", will cause the server to retrieve the requested file. When the entire file has been retrieved, the State argument will return icResponseCompleted (12). At that point, you can use the GetChunk method to retrieve the data from the buffer. This is shown in the example below:
[pre]Private Sub Inet1_StateChanged(ByVal State As Integer)   Dim vtData As Variant ' Data variable.   Select Case State   ' ... Other cases not shown.   Case icResponseCompleted ' 12     ' Open a file to write to.     Open txtOperation For Binary Access _     Write As #intFile     ' Get the first chunk. NOTE: specify a Byte     ' array (icByteArray) to retrieve a binary file.     vtData = Inet1.GetChunk(1024, icString)     Do While LenB(vtData) > 0       Put #intFile, , vtData       ' Get next chunk.       vtData = Inet1.GetChunk(1024, icString)     Loop     Put #intFile, , vtData     Close #intFile   End SelectEnd Sub[/pre]Logging on to FTP Servers
FTP servers come in two flavors: public and private. Public servers, as suggested by the name, are open to anyone. Private servers, on the other hand, won't let you log on unless you are a bona fide user of the server. In either case, the FTP protocol demands that you supply a user name and a password. The two are used to authenticate a user and allow (or disallow) subsequent actions.
To log on to public servers the common practice is to log in as "anonymous," (UserName = "anonymous") and send your e-mail name as the password. However this process is simplified even further with the Internet Transfer control. By default, if you do not supply UserName and Password property values, the control sends "anonymous" as your UserName, and your e-mail name for the Password.
If you are logging on to a private server, simply set the UserName, Password, and URL properties as appropriate, and invoke the Execute method, as shown in the example below:
[pre]With Inet1   .URL = "ftp://ftp.someFTPSi...om"   .UserName = "John Smith"   .Password = "mAuI&9$6"   .Execute ,"DIR"   ' Returns the directory.   .Execute ,"CLOSE" ' Close the connection.End With[/pre]After you have invoked the Execute method, the FTP connection will remain open. You can then continue to use the Execute method to perform other FTP operations such as CD and GET. When you have completed the session, close the connection using the Execute method with the CLOSE operation. You can also close the connection automatically by changing the URL property, and invoking either the OpenURL or Execute method; such action will close the current FTP connection, and open the new URL.


挖出答案的难度,取决提问的深度!
献花 x1 回到顶端 [6 楼] From:台湾中华电信股份有限公司 | Posted:2011-08-31 23:33 |
kb041204
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x0 鲜花 x14
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

我没有用无名也来支持大大,加油帮我们制造多一点实用的程式


我用晒D钱来买威望 =,=
献花 x0 回到顶端 [7 楼] From:没有资料 | Posted:2012-01-07 23:25 |
毛利
个人文章 个人相簿 个人日记 个人地图
路人甲
级别: 路人甲 该用户目前不上站
推文 x0 鲜花 x2
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

这个好用吗....................`


献花 x0 回到顶端 [8 楼] From:台湾中华电信股份有限公司 | Posted:2012-11-28 17:52 |
racky1224
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x0 鲜花 x5
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

威望真的好高


献花 x0 回到顶端 [9 楼] From:台湾新世纪资通股份有限公司 | Posted:2013-03-16 11:10 |

<<   1   2  下页 >>(共 2 页)
首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.063326 second(s),query:16 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言