Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > VB6 > Програма поиск


Автор: Dred 7.3.2007, 13:22
Я хочу зделать прогу которая ищет файлы по расширению.

Как ето осуществить?


Автор: Akina 7.3.2007, 13:35
Читаем описание функции Dir()


Автор: Dred 7.3.2007, 13:38
Дай ссылку плиз...у меня нет MSDN

Автор: Akina 7.3.2007, 13:42
Dir Function Example
This example uses the Dir function to check if certain files and directories exist. 

Код

Dim MyFile, MyPath, MyName
' Returns "WIN.INI"  if it exists.
MyFile = Dir("C:\WINDOWS\WIN.INI")   

' Returns filename with specified extension. If more than one *.ini
' file exists, the first file found is returned.
MyFile = Dir("C:\WINDOWS\*.INI")

' Call Dir again without arguments to return the next *.INI file in the 
' same directory.
MyFile = Dir

' Return first *.TXT file with a set hidden attribute.
MyFile = Dir("*.TXT", vbHidden)

' Display the names in C:\ that represent directories.
MyPath = "c:\"   ' Set the path.
MyName = Dir(MyPath, vbDirectory)   ' Retrieve the first entry.
Do While MyName <> ""   ' Start the loop.
   ' Ignore the current directory and the encompassing directory.
   If MyName <> "." And MyName <> ".." Then
      ' Use bitwise comparison to make sure MyName is a directory.
      If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
         Debug.Print MyName   ' Display entry only if it
      End If   ' it represents a directory.
   End If
   MyName = Dir   ' Get next entry.
Loop


Автор: cardinal 7.3.2007, 15:19
И опять же таки можно глянуть в FAQ в раздел "Файлы и папки".

Автор: ~FoX~ 7.3.2007, 21:21
API -FindFirst, FindNext, FindClose..+рекурсия....
Цитата(Dred @  7.3.2007,  14:38 Найти цитируемый пост)
MSDN 

http://msdn2.microsoft.com/ru-ru/default.aspx

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)