Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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
 
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"




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.