0

hello

please find and try to help me about this problem> at this file ( Global.asax ) and you can check my website: http://www.almusairiey.com

Compiler Error Message: BC30205: End of statement expected.

Source Error:

Line 16:
Line 17: Function GetParentDir() As String
Line 18: Dim PD String = Server.MapPath("db\")
Line 19: PD = System.IO.Directory.GetParent(PD).ToString & "db\"
Line 20: Return PD

4
Contributors
4
Replies
16
Views
2 Years
Discussion Span
Last Post by SteveDotNet
0

That \ is the .Net escape character.
Say you wanted to split a string on the double quote you would write it as
split("\"") otherwise the second quote gets detected as the end of the string.

Which means you need to have ("db\") to stop the \ being the escape character and be read as the character you actually want.

0

You can use @"db\". The @ tells the compiler not to treat the \ as an escape character.
From MSDN:
because the backslash () is an escape character, literal backslashes in a string must be escaped or the entire string must be @-quoted.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.