Solved

Create a list of variables via a wildcard

Posted on 2006-10-23
3
165 Views
Last Modified: 2010-04-24
I would like to create some variables that would list 3-4 files with the same name, but have different extensions.  So the user can click on a file such as:  \\server\location\testfile.xpi and then I can get a list of all the files with the same name but have different extensions such as:
X=\\server\location\testfile.xpi
Y=\\server\location\testfile.zip
Z=\\server\location\testfile.lsi

I currently have my script setup to where the user can click on one filename and create the x variable, but not sure how I can automate it to add the other 2-3 variables.
Thanks, Chad
0
Comment
Question by:chadmanvb
3 Comments
 
LVL 13

Expert Comment

by:newyuppie
ID: 17793491
there's the FileInfo class in system.IO, where you can separate filenames from extensions, or directory names, etc. its pretty useful
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 17793587
See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiodirectoryinfoclassgetfilestopic2.asp

Strip off the extension and replace it with *:

    \\server\location\testfile.*

Pass that to GetFiles() and it will return the list you want...
0
 

Author Comment

by:chadmanvb
ID: 17800643
getfiles() worked great.  Thanks, Chad
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question