Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / November 2006

Tip: Looking for answers? Try searching our database.

directory.getfiles

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
frogman7 - 06 Oct 2006 01:38 GMT
directory.getfiles(path, "*.htm") finds .htm and .html files
same if you are looking for .c it finds .css also

is there a fuction that just gets the file extention specified?
Cor Ligthert [MVP] - 06 Oct 2006 04:36 GMT
Yes,

http://msdn2.microsoft.com/en-us/library/wz42302f.aspx

Cor

> directory.getfiles(path, "*.htm") finds .htm and .html files
> same if you are looking for .c it finds .css also
>
> is there a fuction that just gets the file extention specified?
frogman7 - 06 Oct 2006 05:32 GMT
AFter reading the doc it looks like i will have to try a different
approach

i want the user to be able to search for *.htm and only get the files
that have an htm extention not the html files.  so i will have to add
some code to see if they only want the htm files and just return
thoses.

if you have any suggestions please let me know
gene kelley - 06 Oct 2006 07:05 GMT
>AFter reading the doc it looks like i will have to try a different
>approach
[quoted text clipped - 5 lines]
>
>if you have any suggestions please let me know

One way -
This Mainpages folder contains a mix of files with .htm & .html extensions.

The resulting displayed  listbox displays only the files with the .htm extensions.

       Dim di As New DirectoryInfo("E:\Web Projects\Mainpages")
       Dim fi As FileInfo() = di.GetFiles("*.htm")
       For Each fiTemp As FileInfo In fi
           If fiTemp.Extension = ".htm" Then
               Me.ListBox1.Items.Add(fiTemp.Name)
           End If
       Next

Gene
frogman7 - 13 Oct 2006 21:12 GMT
what i am trying to do is something similar to the search that windows
does to find files and folders.  I am putting a start directory and
want to find all the file (including the files in the sub folders) so i
can write each line to a master file.  i have it working but it uses
loops and it extremely slow.  Is there a function that grabs all the
files from a folder and subdirecies?
iqubal@gmail.com - 30 Nov 2006 17:22 GMT
Do it Like this
    FileInfo Myfile = new FileInfo(strFiles[i]);
    if (Myfile.Extension.Length==4)   
               {

               }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.