Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

(VB)FTPÒì²½ÏÂÔØ

 ¸Ã·½·¨²»ÐèҪʹÓÃAPI¼°µÚÈý·½¿Ø¼þ
ÕâÀïʹÓõÄÊÇVBµÄUserControl¿Ø¼þµÄAsyncRead·½·¨
²½ÖèÈçÏÂ:
1¡¢Ìí¼ÓÒ»¸öÓû§¿Ø¼þ£¬ÉèÖÃInvisibleAtRuntimeÊôÐÔΪtrue£¬Ä¿µÄÊÇÔËÐÐʱ¸Ã¿Ø¼þ²»ÏÔʾÓû§½çÃ棬¾ÍÏóTimer¿Ø¼þÒ»Ñù¡£
2¡¢µ½×Ô¶¨Òå¿Ø¼þµÄ´úÂë´°¿Ú£¬Ìí¼ÓÈçÏ´úÂë
Option Explicit
'ÏÂÔؽá¹ûö¾Ù
Public Enum DownloadResults
eSUCCESS = 0 'ÏÂÔسɹ¦
eCONNECTERROR = 1 'Á¬½Ó´íÎó
eTRANSFERERROR = 2 'Êý¾Ý´«Êä´íÎó
eWRITEERROR = 3 '±£´æ±¾µØ´íÎó
eUserStop = 4 'ÖÐÖ¹
End Enum
'ÏÂÔؽø¶Èʼþ Identifier-ÏÂÔرêʶ,RecvdBytes-ÒÑÏÂÔØ×Ö½ÚÊý,MaxBytes-×Ü×Ö½ÚÊý,PassTimer-ÒÑÓÃÏÂÔØʱ¼ä(Ãë)
Public Event DownloadProgress(Identifier As String, RecvdBytes As Long, MaxBytes As Long, PassTimer As Long)
'ÏÂÔØÍê³Éʼþ Identifier-ÏÂÔرêʶ,ccDownloadResults-ÏÂÔؽá¹û,PassTimer-ÒÑÓÃÏÂÔØʱ¼ä(Ãë)
Public Event DownloadComplete(Identifier As String, Result As DownloadResults, PassTimer As Long)
Dim FstrURL As String 'FTP ÏÂÔØ×Ö·û´®,º¬IP,¶Ë¿ÚºÅ,Óû§Ãû,ÃÜÂë,ÏÂÔصÄÎļþ¼°Æä·¾¶
Dim FstrSaveFile As String 'ÏÂÔصÄÎļþ±£´æÔÚ±¾µØµÄÎļþÃû¼°Æä·¾¶
Dim FstrIdentifier As String 'ÏÂÔرêʶ
Dim FlngStart As Long '¿ªÊ¼ÏÂÔØʱ¼ä
'ÏÂÔØÎļþ
'strURL FTP ÏÂÔØ×Ö·û´®,º¬IP,¶Ë¿ÚºÅ,Óû§Ãû,ÃÜÂë,ÏÂÔصÄÎļþ¼°Æä·¾¶
' ÐÎÈç ftp://Óû§Ãû:ÃÜÂë@FTPµØÖ·/Ŀ¼/Îļþ
'strSaveFile ±£´æʱµÄ±¾µØÎļþÃû
'strIdentifier ÏÂÔرêʶ,¿ÉÒÔͬʱÏÂÔضà¸öÎļþ,ÒÀ¾Ý´Ë×Ö·û´®Çø±ðËùÏÂÔصÄÎļþ
Public Sub DownLoad(ByVal strURL As String, ByVal strSaveFile As String, ByVal strIdentifier As String)
On Error GoTo ERRHAND
FstrURL = strURL
FstrSaveFile = strSaveFile
FstrIdentifier = strIdentifier

FlngStart = Timer

UserControl.AsyncRead strURL, vbAsyncTypeByteArray, strIdentifier, vbAsyncReadForceUpdate

Exit Sub
ERRHAND:
RaiseEvent DownloadComplete(strIdentifier, eCONNECTERROR, Timer - FlngStart)
End Sub
Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
On Error GoTo Errs


Ïà¹ØÎĵµ£º

ASP.NetÖÐʹÓÃVB.Netµ÷Óô洢¹ý³Ì²¢µÃµ½·µ»ØÖµ


ASP.NetÖÐʹÓÃVB.Netµ÷Óô洢¹ý³Ì²¢µÃµ½·µ»ØÖµ
À´Ô´£ºqqreadÂÛ̳ ×÷Õߣº ³ö´¦£ºÇÉÇɶÁÊé 2006-08-03 ½øÈëÌÖÂÛ×é
//´æ´¢¹ý³Ì´úÂë
¡¡CREATE PROCEDURE [AddNewInvoiceInfo] (@sUserID int,@sClaimMethod varchar(50),@sInvoiceNum ¡¡varchar(50),@sInvoiceDate datetime,@sBuyCity varchar(50))AS
¡¡Insert Into SMB_In ......

VBµÄput£¬getº¯Êý

 
Put Óï¾ä
½«Ò»¸ö±äÁ¿µÄÊý¾ÝдÈë´ÅÅÌÎļþÖС£
Put [#]filenumber, [recnumber], varname
Get Óï¾ä
½«Ò»¸öÒÑ´ò¿ªµÄ´ÅÅÌÎļþ¶ÁÈëÒ»¸ö±äÁ¿Ö®ÖС£
Get [#]filenumber, [recnumber], varname
ÀýÈ磺
dim B as byte
open "File1.txt" for binary as #1
get #1, 1, B
close #1
¼´¿É½«File1.txtÎļþµ ......

asp vb.net ÔÚÏßͳ¼Æ ¼òµ¥°æ±¾ ºÍ¾«È·°æ±¾

 ¼òµ¥
ÔÚGlobal.asaÎļþÖмÓÈëÈçϵĴúÂ룺
Java´úÂë
1. <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
2.
3. Sub Application_OnStart
4.
5. 'µ±·þÎñÆ÷¿ªÆôʱ£¬ÉèÖÃÔÚÏßÓû§¼ÆÊýÆ÷Ϊ0
6. Application("ActiveUsers") = 0
7.
......

VB: È¡ÍøÒ³Ô´Âë

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ( _
    ByVal pCaller As Long, _
    ByVal szURL As String, _
    ByVal szFileName As String, _
    ByVal dwReserved As Long, _
  ......

VBÖеõ½ÆÁĻ֧³ÖµÄ·Ö±æÂʺÍɫλ

http://topic.csdn.net/t/20030306/11/1497896.html#
 ¹¤³ÌÎļþÃû£ºChdsp.vbp  
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\PWIN95\SYSTEM\\STDOLE2.TLB#OLE Automation
Module=Module1; ChDsp.bas
Form=ChDsp.frm
Startup="Form1"
He ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ