Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 9th, 2011, 08:38 AM
Authorized User
Points: 437, Level: 7
Points: 437, Level: 7 Points: 437, Level: 7 Points: 437, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2008
Location: , , .
Posts: 85
Thanks: 10
Thanked 0 Times in 0 Posts
Default Illegal characters in path error!!

Hi All,

I am getting below error, when passing the path which has space between the folder name.

"System.ArgumentException: Illegal characters in path"

I have declared the the path in the variable like below:

Dim sFilename As String = "C:\Test\Windows Service\Schedule.xml"

or I have tried like this as well but same error I am getting.

Dim sSFilename As String = """C:\Test\Windows Service\Schedule.xml"""

and passing this file name to the below code:

Code:
 
Dim docDataSet As New DataSet
Dim docReader As New XmlDocument
Dim xnl As XmlNodeList
 docReader.Load(sSchFileName)
 xnl = docReader.SelectNodes("//datetime[text()='" & sDayTime & "']/..")
Could someone please tell me how to resolve this issue.
Thanks
-Nelly
Reply With Quote
  #2 (permalink)  
Old May 9th, 2011, 09:02 AM
Authorized User
Points: 448, Level: 7
Points: 448, Level: 7 Points: 448, Level: 7 Points: 448, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2011
Posts: 86
Thanks: 1
Thanked 12 Times in 12 Posts
Default

Hi,


unfortunately vb.net can't use the at-sign to define a string as a string literal.

Therefor, as far as I know, all you can do is escape each character like this:
Dim sFilename As String = "C:\\Test\\Windows Service\\Schedule.xml"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rooted Path Error cortttt BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 September 3rd, 2009 06:51 AM
ERROR: Illegal characters in path owen_xgy .NET Framework 2.0 8 April 2nd, 2008 10:21 AM
Error while setting class path sujithmathew Linux 1 August 3rd, 2007 01:02 PM
Error: Could not find a part of the path eelisMX Pro VB.NET 2002/2003 2 July 4th, 2006 02:22 AM
Non-english characters gives error ergec Pro PHP 2 February 24th, 2004 09:00 PM



All times are GMT -4. The time now is 05:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.