Hello!

The situation is very strange, here is an example of the code that works:

string UserName = "dalcaev"; var f = cAD.GetUser("dalcaev"); MessageBox.Show(f.Name); 

Why doesn't it work like that?

  string UserName = loginArr[0]; var f = cAD.GetUser(UserName); MessageBox.Show(f.Name); 

In loginArr[0] I pass "dalcaev" exactly there, but in the end I get an error, you can look at the screenshot. What's wrong? Thank! enter image description here

Did a check

enter image description here

Closed due to the fact that it is off-topic by the participants andreycha , Mirdin , awesoon , ixSci , Regent Jul 3 '15 at 15:15 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - andreycha, Mirdin, awesoon, ixSci, Regent
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    В loginArr[0] точно передаю туда "user" - and judging by the Watch window, there is "dalcaev" . - awesoon
  • @soon Named conditionally by the user - shatoidil
  • one
    @shatoidil conditionally - compare two lines. write in the code bool smsth = UserName == "user" , where "user" is a string from the working version. and look at the result. - PashaPash
  • @PashaPash gives false - shatoidil 2:41 pm
  • one
    @shatoidil, the problem is that now the question contains two pieces of code. You claim that the first option works, and the second does not. By adding Я условно назвал "user" , you only confused the responders, because now the code in question is clearly at odds with the code on your local machine. Please correct the code and screenshot so that they truly reflect the working and non-working versions. - awesoon 2:43 pm

1 answer 1

Sorry! It turns out the letter C in the word dalcaev was written in Russian!

That is why this error occurred!