Advertisement

01.14.2005 at 01:16AM PST, ID: 21274247
[x]
Attachment Details

Daft Variable Problem - ugent

Asked by Type25 in C# Programming Language

Ok......how do i even begin to explain this.............well it all begin this morning when i saw a UFO.....


I have a sockets application (which is irrelevant), given the code below, which a portion of this:

            public static string checkData(string data)
            {
                  
                  // hack - reset data
                  if (data.Substring(0, data.Length - 2) == "resetdata") option10();
                  
                  // parse the string and check for the AgentID
                  string tmp =  data.Substring((data.IndexOf("=")+1));
                  string [] strArray = tmp.Split((char)4);
                  string agentID = strArray[0];

                  // Before we handle the data, let's first check if we're setting up a new passport
                  // this is decided by the string: data=tempcode(char(4))code
                  // so agentID will infact equal tempcode
                  if (agentID == "tempcode")
                  {
                        string moo = strArray[1].ToString();
                        string baa = moo.Substring(0,moo.Length -2);
                        return Authenticate.setupNewPassport(moo,connStr);
                  }


data variable = "data=tempcode(char4)blah(char 3)"     (obviously char 4 and 3 are replaced with actual char 3 and 4)

Everything is absolutely find all the way up to if (agentID == "tempcode")

it drops down onto string moo = ...etc     that evaluates to  "blah(char3)"   which is absolutely correct.

Now i need to strip of the character at the end of the string............. you would THINK that  string baa line would do that....

It litterally just skips over that line and when i try an intrerrogate it in the command window it says it's out of scope!!!

I just don't understand, whatever i try (and that's everything) i can't seem to stip off the end char !!!!

Help......pleeaseStart Free Trial
 
Loading Advertisement...
 
[+][-]01.14.2005 at 01:33AM PST, ID: 13042469

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.14.2005 at 01:41AM PST, ID: 13042496

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.14.2005 at 07:42AM PST, ID: 13045012

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.14.2005 at 01:24PM PST, ID: 13048934

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C# Programming Language
Sign Up Now!
Solution Provided By: cwrea
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.14.2005 at 01:25PM PST, ID: 13048956

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.17.2005 at 12:31AM PST, ID: 13061136

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.17.2005 at 07:13AM PST, ID: 13063864

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32