473,734 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get List of File Names from specified Directory

2 New Member
HelowWw fellow programmers :)

I have a web application that opens a pdf file. Very simple indeed. However the file name is not known. The file has to be found by first searching the list of all files present in a particular directory. All i want to know is how do i get a list of the file names in that directory.

Lets say the directory is LBS and this directory contains a number of pdf files. All i want to do is get their names.

Also is there anyway to find out the content of that pdf from within the c# program. The aim is to open a PDF file matching a specific date (the easy way is to rename the pdfs and include the dates which is why i need to get the list of all file names) other way is to open every pdf up and search for the date, if it matches then save that name.

Any help in this regard would be greatly appreciated.

Thank you for your time and support.
Regards

Zeeshan
Nov 3 '06 #1
2 3835
nmsreddi
366 Contributor
hello

if you want to open a particular directory in button click then use filedialod control in c#.net then it will open the default directory what you choosed then you can selet the fie what you need.






regards

nmsreddi
Nov 6 '06 #2
xeshu
2 New Member
Thanks :)
But i have found a way

string fileName = Path.GetFileNam eWithoutExtensi on(mainPath + flist[i]);

put this is a loop and thts it :)
Nov 9 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
4317
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
2
5046
by: John Regan | last post by:
Hello All I am trying to find the owner of a file or folder on our network (Windows 2000 Server) using VB.Net and/or API. so I can search for Folders that don't follow our company's specified folder structure and naming conventions and then send a Net send message to those users telling them to rectify. The information I want to get is when you select the file/folder and then: Properties -> Security Tab -> Advanced Button -> Owner Tab ->...
0
2980
by: Mythran | last post by:
I wrote some code that is supposed to enumerate through the specified file's win32 resources and return a string-array of all icon names. When it runs, it returns a string-array with a bunch of numbers in sequential order (1-55 when ran against iexplore.exe). When I open up iexplore.exe in Visual Studio, I see 23 icons. Each icon has 1 or more sizes of the icon...I'm assuming that there are, in fact, 55 icon resources in iexplore.exe,...
1
4161
by: Little | last post by:
Could someone help me figure out how to put my project together. I can't get my mind wrapped around the creation of the 4 double Linked Lists. Thank your for your insight. 1. Create 4 double linked lists as follows: (a) A double linked list called NAMES which will contain all C like identifiers of less than 256 characters long identified in the input file F. Each identifier
4
2116
by: thoseion | last post by:
Hi, I am trying to get a program working whereby directory and file names are read into a list. I have been given the original list structure - it appears that the directory names should be added to the list, then the filenames added to another separate but connected list within each directory node. So far I have the program working in that the directory and file names are all added to the list, i.e. it currently doesn't distinguish...
3
1405
by: fscked | last post by:
I cannot seem to get this to work. I am hyst trying to read in a list of paths and see if the directory or any sub has a filename pattern. Here is the code: import os, sys from path import path myfile = open("boxids.txt", "r") for line in myfile.readlines(): d = path(line)
3
51493
by: Killer42 | last post by:
Here's a simple VB6 code snippet that uses the FileSystemObject model to find all the files in C:\Temp and load their names into a listbox. To use this sample, you need to set things up as follows: Create a new project in VB6 Add a form (this will probably happen by default, anyway) Pull down the Project menu and choose References. Find Microsoft Scripting Runtime and fill in the checkbox to select it. Click OK. Add a ListBox control to...
6
2926
by: Shawn Minisall | last post by:
I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes to read in the high scores from the file when I play again. This is the error msg python is giving me Traceback (most recent call last): File "<pyshell#0>", line 1, in <module>
5
5805
by: Marge | last post by:
are there any examples of suggested methods to get the same results as the old DriveListBox & DirListBox from VB6. Express uses the openfiledialog but examples would be a great time saver, useful to see things in action to get a better idea. The openfiledialog isn't a visible object so I'm guesiing its used in conjuction with a standard combobox?
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.