Avatar of talker2004
talker2004
Flag for United States of America

asked on 

problem with double backslashes in c#

I am a vb.net programmer, I am starting to work more with c#. I have a vb.net program which calls a c# method. When i pass aDirectory to the c# method it comes through as

c:\\mydir\\theotherdir\\thisdir\\wholebunchofbackslashes\\

Ok, I know about the @ prefixing the string to use literal strings. But nothing i am doing seems to work, and I suspect the double backslashes in the path to be the problem with the function. Please could someone advise me on how i could deal with the double backslashes so that aDirectory looks like this when i am debugging the method.

c:\mydir\theotherdir\thisdir\wholebunchofbackslashes\

thakns in advance

public static void CreateVirtualDirectory(string aRootFolder, string aVirtualDirectoryName, string aDirectory)
        {
         // create the iis virtual directory
        }

Open in new window

.NET ProgrammingC#

Avatar of undefined
Last Comment
talker2004

8/22/2022 - Mon