Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# conversion on @ character
Message
From
01/11/2006 04:09:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/11/2006 03:01:28
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01166075
Message ID:
01166079
Views:
14
>This is a C# line:
>
>
>GetFreeSpace(@"\\\\myserverName\\d$");
>
>
>No converter on the net seems to be able to convert that line. What does the @ stands for anyway?

When a string literal is prefixed with @ then it can span several lines and treated as is with spaces (like VFP's text...endtext) but more importantly escape characters are handled differently. ie:
Without a @ \ in a path string should be escaped ( escape char is \ so it should be \\ when you mean a backslash ).
strPath = "c:\\myFolder\\myFile.txt"
is equivalant to:
strPath = @"c:\myFolder\myFile.txt" ( w/o @ this would lead to error \m is not a recognized escape sequence - there are a series of known sequences like:
\n = newline
\t = tab
\" = doublequotes
\r = carriage return
...)

So I think in your sample it was a typo to put @ there. It'd be interpreted as:

\\\\myserverName\\d$

When it should be:
\\myserverName\d$

Etiher remove @ or rewrite as:
GetFreeSpace(@"\\myserverName\d$");
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform