473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.

System.IO.IOException: The filename, directory name, or volume label
syntax is incorrect.
I have hit a problem for which I can find no solutions. Has anyone any
ideas?

I am writing XML into a Memory STream and using a Transform to make
HTML. This works fine normally, but I have no the above stated error.

I did get some odd chars in the HTML name which caused a problem,
which I corrected. The current error seems to random. I am wondering
if memory is the problem, or disk space.

Last Trace - html 2-->../Grohe/Grohe-Sundries-Handles-Handles-Automatic-2000-47255000.html<--
shows the filename

Code:

string HTMLName = xmlName;

Trace.Warn ("html--" + HTMLName);
string thisManNameDir = thisManName;
thisManNameDir = thisManNameDir.Replace(" ","");

HTMLName = "../" + thisManNameDir + "/" + HTMLName;
Trace.Warn ("html 2-->" + HTMLName + "<--");
//Trace.Warn("writing html" + HTMLName );
XmlUrlResolver resolver = new XmlUrlResolver();

string thisURL1 = Request.Url.ToString();
Trace.Warn("header " + thisURL1);
thisURL1 = thisURL1.Replace("/myxml/Xml1.aspx","");
string thisURL = thisURL1.Replace("http://","");

thisURL1 = thisURL1.Replace(".co.uk","");
thisURL1 = thisURL1.Replace(".com","");
thisURL1 = thisURL1.Replace(".biz","");

thisURL1 = thisURL1.Replace("http://www.","");
string thisDomain = thisURL1.Replace("http://","");

NetworkCredential cred = new
NetworkCredential(thisDomain,"pwd",thisURL);
thisStream.Position = 0;
Trace.Warn("a");
//XmlTextReader myTxtReader = new XmlTextReader (thisStream);
Trace.Warn("a1");
string xslPath = Server.MapPath("myXSL.xsl");
Trace.Warn("a2");
string htmlPath = Server.MapPath(HTMLName);
Trace.Warn("a3");
XPathDocument aXPathDocument = new XPathDocument(thisStream);
Trace.Warn("a4");
XslTransform transform = new XslTransform();
Trace.Warn("a5");
transform.Load(xslPath, resolver);

StreamWriter aStreamWriter = new StreamWriter(htmlPath);

Trace.Warn("a6");
transform.Transform(aXPathDocument,null,aStreamWri ter, resolver);

aStreamWriter.Flush();
aStreamWriter.Close();


Trace.Warn("a7");
//Trace.Warn("ending html");

}
Nov 18 '05 #1
3 5139
I solved this.

"Trevor" <sa***@logicians.com> wrote in message
news:88**************************@posting.google.c om...
System.IO.IOException: The filename, directory name, or volume label
syntax is incorrect.
I have hit a problem for which I can find no solutions. Has anyone any
ideas?

I am writing XML into a Memory STream and using a Transform to make
HTML. This works fine normally, but I have no the above stated error.

I did get some odd chars in the HTML name which caused a problem,
which I corrected. The current error seems to random. I am wondering
if memory is the problem, or disk space.

Last Trace - html 2-->../Grohe/Grohe-Sundries-Handles-Handles-Automatic-2000-47255000.html<-- shows the filename

Code:

string HTMLName = xmlName;

Trace.Warn ("html--" + HTMLName);
string thisManNameDir = thisManName;
thisManNameDir = thisManNameDir.Replace(" ","");

HTMLName = "../" + thisManNameDir + "/" + HTMLName;
Trace.Warn ("html 2-->" + HTMLName + "<--");
//Trace.Warn("writing html" + HTMLName );
XmlUrlResolver resolver = new XmlUrlResolver();

string thisURL1 = Request.Url.ToString();
Trace.Warn("header " + thisURL1);
thisURL1 = thisURL1.Replace("/myxml/Xml1.aspx","");
string thisURL = thisURL1.Replace("http://","");

thisURL1 = thisURL1.Replace(".co.uk","");
thisURL1 = thisURL1.Replace(".com","");
thisURL1 = thisURL1.Replace(".biz","");

thisURL1 = thisURL1.Replace("http://www.","");
string thisDomain = thisURL1.Replace("http://","");

NetworkCredential cred = new
NetworkCredential(thisDomain,"pwd",thisURL);
thisStream.Position = 0;
Trace.Warn("a");
//XmlTextReader myTxtReader = new XmlTextReader (thisStream);
Trace.Warn("a1");
string xslPath = Server.MapPath("myXSL.xsl");
Trace.Warn("a2");
string htmlPath = Server.MapPath(HTMLName);
Trace.Warn("a3");
XPathDocument aXPathDocument = new XPathDocument(thisStream);
Trace.Warn("a4");
XslTransform transform = new XslTransform();
Trace.Warn("a5");
transform.Load(xslPath, resolver);

StreamWriter aStreamWriter = new StreamWriter(htmlPath);

Trace.Warn("a6");
transform.Transform(aXPathDocument,null,aStreamWri ter, resolver);

aStreamWriter.Flush();
aStreamWriter.Close();


Trace.Warn("a7");
//Trace.Warn("ending html");

}

Nov 18 '05 #2
Hello. I know it's been almost 3 years since this post, but I'm experiencing the same problem that you had and you're the only person who seems to have an idea on how to fix it. Do you remember what your problem was and how you resolved it?

Thanks in advance.

From http://www.developmentnow.com/g/8_20...incorrect-.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
May 22 '07 #3

"IIT Guy" <no****@developmentnow.comwrote in message
news:c2**********************************@developm entnow.com...
Hello. I know it's been almost 3 years since this post, but I'm
experiencing the same problem that you had and you're the only person who
seems to have an idea on how to fix it. Do you remember what your problem
was and how you resolved it?
The '..' characters are not allowed.
May 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Glenn A. Harlan | last post by:
Why am I receiving the below error when calling - Path.GetTempFileName() The directory name is invalid. Description: An unhandled exception occurred during the execution of the current web...
3
by: Bob Greschke | last post by:
....the name for a drive (hard or removable) that shows up when, for example, a USB flash drive is recognized by the system. I don't know if this shows up somewhere in Linux. Can this be set...
1
by: Trevor | last post by:
Also posted in general ASP.NET forum. System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. I have hit a problem for which I can find no solutions. Has...
1
by: Eddie | last post by:
Hi, Can anyone provide an example of getting a hard disk/cdrom volume label in C#.net? Thanks in advance, Eddie
8
by: Dmitry Klymenko | last post by:
Do exists a way to detect a volume label of a disk? I've found the way to do this using WMI (System.Management) or winapi function. The second solution is principal non-portable in future, the first...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
12
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current directory) in C programming language and under Unix, but...
7
by: sumanta123 | last post by:
Dear Sir when i am getting the value from properties file the the path showing http://127.0.0.1:81/help/Subject of Issue.txt which is right. But in jsp in try block when pass SubjectofIssue path...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.