Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

¹ØÓÚVBµÄListBox¿Ø¼þÑ¡¶¨ÏîµÄ»ñÈ¡

 ½ñÌìÔÚ×öVBÏîÄ¿µÄʱºò£¬Ê¹ÓÃÁËListBox¿Ø¼þÀ´»ñȡһЩÁбíÏÓÃÁ˲ŷ¢ÏÖûÓÐListViewºÃÓã¬ListViewÓÐItems£¨SelectItem£©¿ÉÒÔ¶¨Î»µ½µ±Ç°µÄÑ¡ÖÐÏ¶øListBoxûÓУ»ListViewÓÐTag¿ÉÒÔÉ趨ѡÖÐÏîµÄ±êʾ£¬ListBoxûÓС£ÉÏÍøÒ²ÕÒ²»µ½Ô­Òò£¬ÖªµÀÈ¥ÔĶÁMSDNºÍ×Ô¼º²âÊÔ¡£
Ö®ºóÖÕÓÚÕÒµ½ÁËÎÊÌâµÄ¹Ø¼ü¡£
ʼþ1£ºÌí¼ÓListBoxÏ ......

BarCode Ëã·¨ VBÀà¿â 2

 
Option Explicit
Public Function ascii2Char(strInput As String) As String
Dim i As Integer
Dim strTemp As String
Dim nPos As Integer
Dim nValue As Integer
i = 1
nPos = InStr(i, strInput, "&#", vbTextCompare)
While (nPos > 0)
    ascii2Char = ascii2Char + Left(st ......

VB³ÌÐòÖÐÓÃADO¶ÔÏó¶¯Ì¬´´½¨Êý¾Ý¿âºÍ±í

    ÕªÒª£º ±¾ÎIJûÊöÁËÔÚVB³ÌÐòÖÐÀûÓÃADO¶ÔÏó¶¯Ì¬´´½¨Êý¾Ý¿âºÍÊý¾Ý±íµÄ·½·¨£¬ÕâЩ·½·¨ÔÚ¿ª·¢VBÊý¾Ý¿âÓ¦ÓóÌÐòÖкÜÓÐʵÓüÛÖµ£¬Ëü¿ÉÒÔÌá¸ßÊý¾Ý¿â³ÌÐòÁé»îÐÔ¡£
¡¡¡¡¹Ø¼ü´Ê£ºÊý¾Ý¿â¡¢Êý¾Ý±í¡¢ADO¡¢ADOX
¡¡¡¡1: ÎÊÌâµÄÌá³ö
¡¡¡¡ÔÚVisual BasicÖУ¬³£ÓõÄÊý¾Ý·ÃÎʽӿÚÓÐÏÂÁÐÈýÖÖ£ºÊý¾Ý¿â·ÃÎʶÔÏó(DAO£¬Data A ......

VB³ÌÐòÖÐʹÓýű¾Ö§³Ö

 ÕýÔÚ¿ª·¢Ð¡ÃØÊéϵͳ²¢²»¶ÏÌá¸ßÆäÖÇÄÜˮƽ,ÆäÖÐÓõ½µÄÊǽű¾Ö§³ÖµÄ¼¼Êõ
ËäÈ»Õⲿ·Ö²»ÊôÓÚ³õѧÕßʹÓÃ,È»¶øÓÐЩÈËÏëѧÕâ¸ö¶«¶«,ÕâÀï¾Í·¢~~~²¼³öÈ¥°É!
н¨Ò»¸ö±ê×¼exe¹¤³Ì(Standard EXE);
"¹¤³Ì"(Project)-->"²¿¼þ"(Components)
Ñ¡¶¨"Microsoft Script Control 1.0" ,λÖÃÊÇC:\WINDOWS\system32\msscript.ocx
Ìí ......

VB´íÎó´úÂë

3,Return without GoSub
5,Invalid procedure call
6,Overflow
7,Out of memory
9,Subscript out of range
10,This array is fixed or temporarily locked
11,Division by zero
13,Type mismatch
14,Out of string space
16,Expression too complex
17,Cant perform requested operation
18,User int ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ