Click here to Skip to main content
15,889,728 members
Home / Discussions / C#
   

C#

 
GeneralRe: run .exe file in a panel Pin
OriginalGriff9-Mar-12 22:24
mveOriginalGriff9-Mar-12 22:24 
AnswerRe: run .exe file in a panel Pin
DaveyM699-Mar-12 22:11
professionalDaveyM699-Mar-12 22:11 
AnswerRe: run .exe file in a panel Pin
Ravi Bhavnani10-Mar-12 4:38
professionalRavi Bhavnani10-Mar-12 4:38 
AnswerRe: run .exe file in a panel Pin
pancakeleh10-Mar-12 8:54
pancakeleh10-Mar-12 8:54 
QuestionC# .net pointer to variable length array Pin
MichCl9-Mar-12 9:54
MichCl9-Mar-12 9:54 
AnswerRe: C# .net pointer to variable length array Pin
PIEBALDconsult9-Mar-12 10:30
mvePIEBALDconsult9-Mar-12 10:30 
AnswerRe: C# .net pointer to variable length array Pin
Luc Pattyn9-Mar-12 13:04
sitebuilderLuc Pattyn9-Mar-12 13:04 
QuestionRegarding file path wildcards Pin
PIEBALDconsult9-Mar-12 9:03
mvePIEBALDconsult9-Mar-12 9:03 
For an app I'm working on, I want the user to be able to include wildcards when specifying the files to open from the command line, e.g. myapp C:\projects\*.cs.
But that causes trouble when I try to extract the path and filename (filespec) with System.IO.Path -- the wildcard characters cause Exceptions.

As a work around, I'm using the following, which works OK, but I doubt it's very robust:

    private void
    OpenFiles
    (
      string[] Paths
    )
    {
      foreach ( string path in Paths )
      {
        int off = path.LastIndexOfAny ( new char[] { '\\' , ':' } ) + 1 ;

        string p = off==0 ? ".\\" : path.Substring ( 0 , off ) ;
        string f = path.Substring ( off ) ;
        foreach ( string fn in System.IO.Directory.GetFiles ( p , f ) )
        {
          OpenFile ( fn ) ;
        }
      }

      return ;
    }


Does anyone here have a better solution to this?
AnswerRe: Regarding file path wildcards Pin
Luc Pattyn9-Mar-12 9:47
sitebuilderLuc Pattyn9-Mar-12 9:47 
GeneralRe: Regarding file path wildcards Pin
PIEBALDconsult9-Mar-12 10:08
mvePIEBALDconsult9-Mar-12 10:08 
AnswerRe: Regarding file path wildcards Pin
Luc Pattyn9-Mar-12 10:13
sitebuilderLuc Pattyn9-Mar-12 10:13 
GeneralRe: Regarding file path wildcards Pin
PIEBALDconsult9-Mar-12 10:20
mvePIEBALDconsult9-Mar-12 10:20 
AnswerRe: Regarding file path wildcards Pin
Luc Pattyn9-Mar-12 10:33
sitebuilderLuc Pattyn9-Mar-12 10:33 
GeneralRe: Regarding file path wildcards Pin
PIEBALDconsult9-Mar-12 10:41
mvePIEBALDconsult9-Mar-12 10:41 
GeneralRe: Regarding file path wildcards Pin
PIEBALDconsult9-Mar-12 15:37
mvePIEBALDconsult9-Mar-12 15:37 
GeneralRe: Regarding file path wildcards Pin
Luc Pattyn9-Mar-12 15:41
sitebuilderLuc Pattyn9-Mar-12 15:41 
GeneralRe: Regarding file path wildcards Pin
PIEBALDconsult9-Mar-12 16:51
mvePIEBALDconsult9-Mar-12 16:51 
QuestionMessage Removed Pin
9-Mar-12 8:18
nassimnastaran9-Mar-12 8:18 
AnswerRe: How to input in DataGridView cell Only Double ... or ... Pin
Ravi Bhavnani10-Mar-12 4:53
professionalRavi Bhavnani10-Mar-12 4:53 
GeneralRe: How to input in DataGridView cell Only Double ... or ... Pin
nassimnastaran10-Mar-12 8:11
nassimnastaran10-Mar-12 8:11 
QuestionCommand Question Pin
Kevin Marois9-Mar-12 7:01
professionalKevin Marois9-Mar-12 7:01 
Questionlistview Pin
abiir9-Mar-12 5:53
abiir9-Mar-12 5:53 
AnswerRe: listview Pin
Dave Kreskowiak9-Mar-12 7:14
mveDave Kreskowiak9-Mar-12 7:14 
AnswerRe: listview Pin
Abhinav S9-Mar-12 15:45
Abhinav S9-Mar-12 15:45 
Questionstreaming video with c# Pin
sileen_Mohammad9-Mar-12 5:32
sileen_Mohammad9-Mar-12 5:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.