Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's the correct syntax for the following c# code
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01037796
Message ID:
01037807
Vues:
14
Paul,
Put '@' in front of the strings or use '\\' instead of '\'. Something like this:
if (strURL.Trim().EndsWith(@"\"))
	URL = strURL.Trim()+@"aesys\default.aspx?clearcache=true";
else
	URL = strURL.Trim()+@"\aesys\default.aspx?clearcache=true";
or
if (strURL.Trim().EndsWith("\\"))
	URL = strURL.Trim()+"aesys\\default.aspx?clearcache=true";
else
	URL = strURL.Trim()+"\\aesys\\default.aspx?clearcache=true";
Einar


>
>if (strURL.Trim().EndsWith("\"))
>	URL = strURL.Trim()+"aesys\default.aspx?clearcache=true";
>else
>	URL = strURL.Trim()+"\aesys\default.aspx?clearcache=true";
>
>
>
>the first line gives me the error "newline in constant". And the 2 lines where I'm trying to build the URL give an error "Unrecognized escape sequence"
>
>Thanks
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform