473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

FindFirstFile

how does one convert the following to VB .NET, given the structures below,
where Path is type String?

hSearch = FindFirstFileW(StrPtr(Path & "*"), VarPtr(WFD))

Dim WFD As WIN32_FIND_DATA

<DllImport("kernel32", CharSet:=CharSet.Unicode, SetLastError:=True)> _
Private Shared Function FindFirstFileW _
(ByVal lpFileName As String, ByVal lpFindFileData As WIN32_FIND_DATA) As
Integer
End Function

Private Structure FILETIME
Dim dwLowDateTime As Integer
Dim dwHighDateTime As Integer
End Structure

Private Const ALTERNATE As Integer = 14
Private Const MAX_PATH As Integer = 260

<Serializable(), StructLayout(LayoutKind.Sequential,
CharSet:=CharSet.Unicode)> _
Private Structure WIN32_FIND_DATA
Dim dwFileAttributes As FileAttributes
Dim ftCreationTime As FILETIME
Dim ftLastAccessTime As FILETIME
Dim ftLastWriteTime As FILETIME
Dim nFileSizeHigh As Integer
Dim nFileSizeLow As Integer
Dim dwReserved0 As Integer
Dim dwReserved1 As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAX_PATH)> _
Dim cFileName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=ALTERNATE)> _
Dim cAlternate As String
End Structure
Jun 23 '06 #1
0 1125

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rich Strang | last post by:
Hi group I have just got the FindFirstFile function working in my small tutorial app, the problem is that I can only seem to get it working when I hard code the search string. I have defined a...
2
by: Masao Kishore | last post by:
I need codes to access all files in all subdirectory in one directory in VC++ or VStudio but in console (DOS) mode. Thank you for your help in advance. M.K.
2
by: tom | last post by:
Hello, I want to know if FindFirstFile() can do more as I expect. FindFirstFile() can take the arguement of "*" or "?", for example, FindFirstFile("result.*.txt", &FileData); I want to...
1
by: Paulo Eduardo | last post by:
Hi, all! We are devleping one app that will use disk access with FindFirstFile and FindNextFile for it. Can someone expose me how works FindFirstFile and FindNextFile in disk access? Does the...
3
by: vighnesh | last post by:
Hello Everyone I am developing a project in VB.NET in which I need to use Win32 API function FindFirstFile()/FindNextFile()/FindClose() The same code is wroking fine in VB 6.0 , but when I used...
2
by: LewS | last post by:
My application uses FindFirstFile for searching for specific file types entered by a user. Entries like c:\myfiles\*.txt and \\myserver\shareddrive\myfiles\*.txt work okay, but when I use a UNC...
9
by: Comcast Newsgroups | last post by:
Hello everyone, I am programming in Visual Studio 2002, VB.net. I typically stick to version 1.0 of the framework for compatibility reasons. Recently, I ran into an issue that I couldn't...
1
by: gudiya | last post by:
hello everybody I am having a very wierd problem.i am developing a win ce applicationin which I am marshalling win ap function findfirstfile and findnextfile in c# .My problem is it reads the file...
3
by: gudiya | last post by:
hi, My code works but i am missing the first 2 characters of file name. Any idea why???? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;...
6
by: haneeshkb | last post by:
I am using the function FindFirstFile to pick files from a folder to process. But the files selecting is based on name ,I need to get the files selected based on datetime( means frst come firstout )....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.