0

Hello,

Still fairly new to all this.

I'm looking for an example on how to let the user select a program name and path, and declare it variable A.

There is more to this request, but I'd trying to figure this out on my own and not beg for a solution to be given. Just a nudge in the right direction.

SteveyD

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by SteveyD
0

>I'm looking for an example on how to let the user select a program name and path, and declare it variable A.

Sorry, I'm not quite following the problem. Do you want to execute user selected program name?

0

Yes, thats the first part of this.

Allow the user to select the directory and program name.

example;

the user clicks a button, and navigates to the program_name.exe file.

That directory/subdirectory(etc)../program_name.exe once selected becomes something like "user_progA = (the directory/subdirectory/program_name.exe)"

I'm still having a hard time trying to explain it., Sorry./

0

Maybe a different explanation;
In the example below, How would you allow the user to define the location of "test.txt" instead of forcing it to only exist as "c:\\test.txt"

# using  System;  
# using  System.IO;  
#   
# class  MainClass  
# {  
#         public  static  void  Main(string[]  args)  
#         {  
#                 FileInfo  file  =  new  FileInfo("c:\\test.txt");  
#   
#                 //  Display  directory  information.  
#                 DirectoryInfo  dir  =  file.Directory;  
#   
#                 if  (dir.Exists)  
#                 {  
#                         Console.Write("Directory  attribute  list:  ");  
#                         Console.WriteLine(dir.Attributes.ToString());  
#                         Console.WriteLine("Directory  contains:  "  +  dir.GetFiles().Length.ToString()  +  "  files");  
#                 }  
#   
#         }  
# }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.