Is it simply that c# converts all strings coming in to double and strings going out to single?

A

AAaron123

I have a function in a c# library:
public static void UnZip(string ZipFileName, string RootFolderName)

{

....snip...

using (ICSharpCode.SharpZipLib.Zip.ZipInputStream s = new
ICSharpCode.SharpZipLib.Zip.ZipInputStream(File.OpenRead(ZipFileName)))

....snip...



That is called from an aspx.vb file as follows:

Zip.UnZip(Server.MapPath("~\Tmp.Zip"), TextBoxRootToUse.Text)



When I do QuickWatches I find the call statement's strings have single
backslashes, but the strings in UnZip have double backslashes.

Is that what you would expect?

Also, what does the file OpenRead see? Single or double backslashes?

Is it simply that c# converts all strings coming in to double and strings
going out to single?

That doesn't seen right to me.

I'm trying to find out why it is not working and am hung up on not knowing
if the above observations indicate a problem or not.

Do you know why/how the single backslashes got converted to double?



Thanks in advance
 
A

Arne Vajhøj

AAaron123 said:
I have a function in a c# library:
public static void UnZip(string ZipFileName, string RootFolderName)

{

...snip...

using (ICSharpCode.SharpZipLib.Zip.ZipInputStream s = new
ICSharpCode.SharpZipLib.Zip.ZipInputStream(File.OpenRead(ZipFileName)))

...snip...

That is called from an aspx.vb file as follows:

Zip.UnZip(Server.MapPath("~\Tmp.Zip"), TextBoxRootToUse.Text)

When I do QuickWatches I find the call statement's strings have single
backslashes, but the strings in UnZip have double backslashes.

Is that what you would expect?

Also, what does the file OpenRead see? Single or double backslashes?

Is it simply that c# converts all strings coming in to double and strings
going out to single?

That doesn't seen right to me.

I believe that they are single backslashes everywhere, but that the VS
debugger just show them as double backslashes to you.

Arne
 
A

AAaron123

Thanks

Peter Duniho said:
[...]
Do you know why/how the single backslashes got converted to double?

It doesn't. It's just how the debugger displays strings. It always
escapes special characters, because (for example) otherwise there would be
no reliable way to know whether when the debugger shows you "\n" whether
that meant a newline or a backslash followed by the character 'n'.
 
A

AAaron123

Thanks

Arne Vajhøj said:
I believe that they are single backslashes everywhere, but that the VS
debugger just show them as double backslashes to you.

Arne
 
Top