Before anyone can give you an answer you do need to decide what your question actually is. You started by asking how to find one file and now that you have that answer you have changed the question.
In the code you posted you used the DirectoryInfo.GetFiles method. If you were to invest some time in reading the documentation for that method and it's overloads you would be able to answer either of your questions on your own.
as usual it helps to read the documentation: there is an overload of GetFileSystemEntries that accepts a filter, where you can specify part of the filename, as if you were searching in Windows Explorer.
BTW: files.GetUpperBound(0) + 1 is terrible, just use files.Length
Luc Pattyn [Forum Guidelines][My Articles] - before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
I am trying to write an add-in for MS Word 2007. This add-in in one of its contexts helps the user create a a template automatically. Whenever a new template is created, these templates have to be avaialable for the user . Now what would i want to do is to create an extra menu specifying the list of "My Comapny" folder which carries all the templates that have been dynamically generated. I would like to have this list as a part of the Templates list i view when i press : Office > New > Templates. I hope you have understood where i would like to see my Template folder.
The MessageBox class hasn't got any public constructors, so you can't inherit from it.
How hard would it be to create a form to do what you want to do?
Display some text, a couple buttons, a LinkLabel and an icon or two?
Come on man...
Judging by your modest signature you should know better than that ;>
I am working with WindowsApplication in VS.NET 2005
I have listed the folders in a drive...for eg:
C:\projects\ports.ports folder in turn contains 10 other folders namely 10000,10001 etc...
I have created a separate application for the client and server to communicate...I have compiled the server application and copied the exe file into folder 10000 and i have included the client as a function in Form1.cs.
In my tool i.e. VS.NET 2005, i have written code to list exe files in a folder.So it gives me Server.exe with a button click.I wanted to run this exe file...I used Start() to do so. The exe file opens when i click start button.
Now i want to send a message from the client to the server(i.e .exe file opened with a button click).Is it possible to do this?
I had a try with this...When i click send button to send message from the client to the exe ,the exe closes...I have not closed the socket in side th code...I dont know why that happens...
Please help me out with this...Thanks for any help in advance.