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

[µo°Ý] §PÂ_Àɮצs¦b§_? µ²ªG¬°"False¤£¦s¦b" ªºÀɮ׿é¥X¤å¦rÀÉ®×

[µo°Ý] §PÂ_Àɮצs¦b§_? µ²ªG¬°"False¤£¦s¦b" ªºÀɮ׿é¥X¤å¦rÀÉ®×

¥»©«³Ì«á¥Ñ webbliu ©ó 2011-8-4 07:11 ½s¿è

Dear ¤j¤j­Ì¡A


½Ð°Ý

¥ÎDir §PÂ_Àɮצs¦b§_®É¡A  ¤]¦³¨Ï¥ÎFile.Exists ªº¤è¦¡

¯à§_§â§PÂ_µ²ªG¤£¦s¦b Falseªº¸ô®|ÀÉ®× ¿é¥X¦Ü¤å¦rÀÉ®×?

³q±`§PÂ_Àɮק¹³£¬O¥H MessageBox.show ("¨q¥XÀɮפ£¦s¦b")

¸Ó¦p¦ó¼g ¤~¯à§â©Ò¦³¤£¦s¦bªºÀɮ׳£¿é¥X¦Ü ¤å¦rÀÉ®×.txt??

¦³«Å§iDim path as String¡A·|¦P®ÉÀˬd«Ü¦hÀɮסC

§Ú·Q­n¥u¦C¥X§PÂ_ÀÉ®×µ²ªG¬°False "¤£¦s¦b" ªº ("¸ô®|ÀÉ®×")~~
½Ð«üÂI~ ÁÂÁ¤j¤j­Ì

if Dir ("path/files") =False  Then

writeline (false path: .....)

¦^´_ 2# chin15


    Dear  
¦pªGÁÙ¬O¬Ý¤£À´ ½Ð¦^´_¡C
«D±`·PÁÂ~

TOP

¥»©«³Ì«á¥Ñ webbliu ©ó 2011-8-5 11:57 ½s¿è

¦^´_ 4# elinbit


    Dear ¤j¤j ÁÂÁÂ~
  ½Ð°Ý~~
   ±ý°õ¦æ®É¥X²{ open ¥¼«Å§i"  ½Ð°Ý¸Ó­È ­n«Å§i¬Æ»ò?
   open FileNum ¤]¬O

Dear ¤j¤j ¶¶«K ½Ð±Ð

¦pªG¬O³o¼Ë

¥ØªºÁÙ¬O¦b§ä¥X¤£¦s¦bªº"¸ô®|ÀÉ®×"
Apath ¬O±qTable Ū¥Xªº"¸ô®|ÀÉ®×"¡A«Ü¦hµ§¡C
¤U­±¨â¬qµ{¦¡ §Ú¦b°µ¤ñ¸û«á ¡A  ¤p©ó10byteªºÀÉ®× ³£µLªk¿é¥X¦Ü.txt¡C
½Ð°Ý¸Ó¦p¦ó­×¥¿
«D±`·PÁÂ
  1. Dim Apath as string  
  2.         Dim R As System.IO.FileInfo
  3.              
  4.             For i = 1 To n  
  5.             R = My.Computer.FileSystem.GetFileInfo("Apath")  
  6.             If R.Length <  10 Then  '½Ð°Ý³o¸ÌªºR.length §ï«ç»ò¼g©O
  7.             Console.writeline(size + "¤p©ó" + Apath)  
  8.             End If  
½Æ»s¥N½X
  1. Dim size as long
  2.         Dim Apath as string
  3.          
  4.         For i = 1 To n
  5.         On Error Resume Next
  6.         size = Filelen(Apath)
  7.         If size <  10 Then
  8.         Console.writeline(size + "¤p©ó" + Apath)
  9.         End If
½Æ»s¥N½X

TOP

¦^´_ 6# elinbit


    Dear ¤j¤j
MSDN ³o¬q§Ú¬Ý¤£À´
¯à§_½Ð§A«ü¾É¡A§Ú¸Ó¦p¦ó§â    exists §PÂ_¤£¦s¦bªºÀÉ®×+¸ô®|¿é¥X¨ì¤å¦r?
  1. Dim path as string
  2. Dim atxt as  new system.Io.StreamWriter("C:\exists.txt")

  3. If system.io.file.exits("path") Then
  4. '§PÂ_¤£¦s¦b ¿é¥X¨ì¤å¦rÀÉ®×.txt
½Æ»s¥N½X

TOP

¦^´_ 8# elinbit


    Dear ¤j¤j

§Ú·Q½Ð°Ý  ­n¨ú±oÀÉ®×®e¶q¸ê°T¡A¬O¤£¬O­n¥Î Fuction GetFilesize

ÁÙ¬O¥i¥Hª½±µ getfilesize
³o¬O§Ú¼gªº¤@¬q¡A¤£ª¾¹D³o¼Ë°µ¹ï¤£¹ï?
  1. Private Function GetFileSize(ByVal p1 As String) As Integer
  2.         Dim myfile As New FileInfo("C:\H.mov")
  3.         Dim filesize As Long = myfile.Length
  4.         Return filesize
  5.     End Function
½Æ»s¥N½X
­ì¥»¬O¥´ºâ§PÂ_FileExists   ¦pªGÀɮפ£¦s¦b¡A´N¦C¥X¥Ø¿ý(¥]§t¸ô®|)......
¦ý«ç»ò¼Ë³£°µ¤£¨ì...§Ú¤Ó»¹¤F¡C

«á¨Ó¬O¥´ºâ¥Î¤ñ¸ûÀÉ®×®e¶q¤j¤p¡A¤p©ó0ªºÀɮצC¥X¥Ø¿ý¤]¥]§tÀɮ׸ô®|......
¦ý¤£ª¾¹D¬°¦ó¡AµL½×¤j©ó¤p©ó0³£¦³³Q¦C¥X......¡C

²{¦b¹J¨ì²~ÀV¤F¡AÁٽФj¤j«ü±Ð¡C
ÁÂÁ¤j¤j!

TOP

¥»©«³Ì«á¥Ñ webbliu ©ó 2011-8-29 11:30 ½s¿è

¦^´_ 10# elinbit


    Dear ¤j¤j  
§Ú¤w¸g¸Ñ¨M¡A·PÁ§Aªº«ü¾É&«Øij
«D±`ÁÂÁÂ
§Úªº¸Ñªk¦p¤U~
  1. Dim sizefile As System.IO.FileInfo
  2. Dim apath As Sting
  3. Dim N As Integer
  4. Dim size =system.IO.Fileinfo

  5. For i =1 to N

  6. sizefile = My.Computer.FileSystem.GetFileInfo(apath)
  7.             On Error Resume Next
  8.             If sizefile.Length < 0 Then
  9.                 file.WriteLine("miss"+ ": " + apath)
  10.                 End If
  11.                 'Else

  12. ProgressBar1.Value = Int(i / n * 100)
  13. ProgressBar1.Refresh()

  14. Next
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¬°¤H³B¥@­n¤p¤ß²Ó¤ß¡A¦ý¤£­n¡u¤p¤ß²´¡v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD