Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question about C# operators
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00992746
Message ID:
00992759
Vues:
13
Einar,

Yes, my problem was with missing '='. Thank you. As to why I use '@' is just a routine. Actually I use it (which I missed typing in UT) in both cases. I know in this case '@' is not necessary, but I have other settings where I need it (when the setting contains escape characters).


>Dmitry,
>The first code block would not compile, but i assume that is just a typo when typing it into UT :)
>
>Now to the problem at hand. You need to use '==' instead of '=' when comparing something in C#. I assume that is the problem.
>Also why did you choose to use the '@' in the second code block? It is not needed.
>
>Einar
>>Could someone explain to me why the following expression works:
>>
>>
>>string PagerDomain = ConfigurationSettings.AppSettings"PagerDomain"];
>>if ((PagerDomain != null) && PagerDomain.Length >0 )
>>
>>
>>But this one gives the error:
>>
>>string PagerDomain =
>>@ConfigurationSettings.AppSettings["PagerDomain"];
>>if ((PagerDomain = null) || PagerDomain.Length <=0 )
>>
>>
>>The error I get is "Operatore || cannot be applied to operand of type 'string' and 'bool'.
>>
>>Thank you so much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform