Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unable to make cast ( what wrong with my code ... ? ) Pin
Yanshof31-Mar-10 11:09
Yanshof31-Mar-10 11:09 
GeneralRe: Unable to make cast ( what wrong with my code ... ? ) Pin
Ian Shlasko31-Mar-10 11:14
Ian Shlasko31-Mar-10 11:14 
Questionwindow ce 6.0 Pin
jashimu31-Mar-10 9:36
jashimu31-Mar-10 9:36 
AnswerRe: window ce 6.0 Pin
Migounette31-Mar-10 11:36
Migounette31-Mar-10 11:36 
QuestionMoving an object with a joystick Pin
Brocksam1331-Mar-10 9:21
Brocksam1331-Mar-10 9:21 
AnswerRe: Moving an object with a joystick Pin
Not Active31-Mar-10 9:56
mentorNot Active31-Mar-10 9:56 
AnswerRe: Moving an object with a joystick Pin
Brocksam1331-Mar-10 16:51
Brocksam1331-Mar-10 16:51 
QuestionCant run application (C#) through cmd Pin
igalep13231-Mar-10 8:15
igalep13231-Mar-10 8:15 
Hey,
I cant execute application through cmd, when the application trying to read the argument which was sent to it (text file), it fails...
when i'm truing to execute it through the IDE (vs2008), it works ok...

that's what i did in the main method :

static void Main(string[] args)
       {
           int choice = 0;

           if (args.Length == 0)
               choice = 1;
           else
               choice = 2;

           switch(choice)
           {
               case 1:
                   {
                       string[] text = Directory.GetFiles("allText");
                       Console.WriteLine(DateTime.Now.ToString());
                       foreach (string fileName in text)
                       {
                           string substring = fileName.Substring(8);


                           ReadData_Logic rd_l = new ReadData_Logic(substring);
                           rd_l.runThreadsAndDecrypt();
                           rd_l.printKey(substring.Substring(0, fileName.Length - 15).Insert(0, "encryptedKey\\") + "_result.txt");

                       }
                       Console.WriteLine(DateTime.Now.ToString());
                   } break;

               case 2:
                   {
                       Console.WriteLine(DateTime.Now.ToString());
                       string fileName = args[0];
                       Console.WriteLine(fileName); <big><--- for debug, here i do see the correct file name</big>
                       ReadData_Logic rd_l = new ReadData_Logic(fileName);
                       rd_l.runThreadsAndDecrypt();
                       rd_l.printKey(fileName + "_result.txt");

                       Console.WriteLine(DateTime.Now.ToString());
                   } break;
           }

       }


what wrong with the code ?
thanks
AnswerRe: Cant run application (C#) through cmd Pin
kevinnicol31-Mar-10 8:26
kevinnicol31-Mar-10 8:26 
AnswerRe: Cant run application (C#) through cmd Pin
OriginalGriff31-Mar-10 8:42
mveOriginalGriff31-Mar-10 8:42 
GeneralRe: Cant run application (C#) through cmd Pin
igalep13231-Mar-10 8:57
igalep13231-Mar-10 8:57 
GeneralRe: Cant run application (C#) through cmd Pin
PIEBALDconsult31-Mar-10 9:20
mvePIEBALDconsult31-Mar-10 9:20 
GeneralRe: Cant run application (C#) through cmd Pin
igalep13231-Mar-10 9:21
igalep13231-Mar-10 9:21 
AnswerRe: Cant run application (C#) through cmd Pin
Ian Shlasko31-Mar-10 10:55
Ian Shlasko31-Mar-10 10:55 
QuestionAdd int to DateTime in C# Pin
jojoba201131-Mar-10 6:47
jojoba201131-Mar-10 6:47 
AnswerRe: Add int to DateTime in C# Pin
kevinnicol31-Mar-10 6:50
kevinnicol31-Mar-10 6:50 
AnswerRe: Add int to DateTime in C# Pin
Luc Pattyn31-Mar-10 7:10
sitebuilderLuc Pattyn31-Mar-10 7:10 
GeneralRe: Add int to DateTime in C# Pin
Richard MacCutchan31-Mar-10 7:35
mveRichard MacCutchan31-Mar-10 7:35 
GeneralRe: Add int to DateTime in C# Pin
PIEBALDconsult31-Mar-10 7:44
mvePIEBALDconsult31-Mar-10 7:44 
GeneralRe: Add int to DateTime in C# Pin
kevinnicol31-Mar-10 7:59
kevinnicol31-Mar-10 7:59 
GeneralRe: Add int to DateTime in C# Pin
Som Shekhar31-Mar-10 9:02
Som Shekhar31-Mar-10 9:02 
GeneralRe: Add int to DateTime in C# Pin
Luc Pattyn31-Mar-10 9:21
sitebuilderLuc Pattyn31-Mar-10 9:21 
GeneralRe: Add int to DateTime in C# Pin
Som Shekhar31-Mar-10 9:24
Som Shekhar31-Mar-10 9:24 
GeneralRe: Add int to DateTime in C# Pin
PIEBALDconsult31-Mar-10 9:21
mvePIEBALDconsult31-Mar-10 9:21 
GeneralRe: Add int to DateTime in C# Pin
Som Shekhar31-Mar-10 9:22
Som Shekhar31-Mar-10 9:22 

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.