ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] vba Ū¨ú ftp ¸Ì­±ªºÀɮײM³æ

¥»©«³Ì«á¥Ñ Joforn ©ó 2020-11-5 23:33 ½s¿è
  1. Private Function FTPFolder(ByVal Url As String, _
  2.     Optional ByVal UserName As String, _
  3.     Optional ByVal PassWord As String, _
  4.     Optional ByVal Port As Integer) As Object
  5.   Dim objShell  As Object
  6.   
  7.   If Len(Url) Then
  8.     If Len(UserName) Then Url = UserName & ":" & PassWord & "@" & Url
  9.     If Port > 0 Then Url = Url & ":" & Port
  10.     Set objShell = CreateObject("Shell.Application")
  11.     Set FTPFolder = objShell.Namespace("FTP://" & Url)
  12.   End If
  13. End Function

  14. Sub Test()
  15.   Dim objFolder As Object
  16.   Dim objItem   As Object
  17.   
  18.   Set objFolder = FTPFolder("0.0.0.0", "username", "password")
  19.   If Not (objFolder Is Nothing) Then
  20.     For Each objItem In objFolder.Items
  21.       Debug.Print "Name=""" & objItem.Name & """ Size=" & objFolder.GetDetailsOf(objItem, 1) & " ModifyDate=" & objFolder.GetDetailsOf(objItem, 3)
  22.     Next
  23.   End If
  24. End Sub
½Æ»s¥N½X
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

¥»©«³Ì«á¥Ñ cody ©ó 2020-11-4 16:27 ½s¿è

¦^´_ 1# warhead


¥Î windows ¤º«Ø ftp.exe Ū¨ú Script ªº¤è¦¡
¤@¯ë¬O±N ftp comment °µ¦¨¤å¦rÀÉ, ¦A¥Î ftp.exe ¥hŪ¨ú°õ¦æ
±Nµ²ªG¦s¦¨¤å¦rÀÉ«á, ¦AŪ¤Jexcel

TOP

        ÀR«ä¦Û¦b : ¯¸¦b¥b¸ô¡A¤ñ¨«¨ì¥Ø¼Ð§ó¨¯­W¡C
ªð¦^¦Cªí ¤W¤@¥DÃD