473,320 Members | 1,961 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,320 software developers and data experts.

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

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 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 now 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 12 '05 #1
1 11392
I solved this.

"Trevor" <sa***@logicians.com> wrote in message
news:88**************************@posting.google.c om...
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 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 now 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 12 '05 #2

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

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
4
by: ScottH | last post by:
I am running 7.2 with fixpack 10a under W2K. I got a backup from someone else in an attempt to debug a data issue. The other person created the database with UTF-8 (codepage 1208), so I created a...
1
by: Krazitchek | last post by:
Hi, i check all directories on a disk but an error occurs when i try to enter in the "System Volume Information" directory. Is there a way to "jump" this directory without to check the name of...
0
by: Giovane Calabrese | last post by:
ok. im try to make a multilanguage system based on that tutorial : http://www.123aspx.com/redir.aspx?res=29112 in my aspx pages all text are in labels , and i want to take the name labels...
3
by: Trevor | last post by:
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...
11
by: Tarren | last post by:
Hi: I need to get the unique GUID for a file, so I am using API calls through System.InteropServices I am using BY_HANDLE_FILE_INFORMATION and
1
by: bahoo | last post by:
Hi, I am using Windows + Python 2.5. This line of code fails (see error message at the end), last_line = subprocess.Popen(, stdout=subprocess.PIPE).communicate() but using "os.system"...
8
by: Michael Robertson | last post by:
I'm having trouble opening a file in linux, whose path has spaces in it. $ mkdir my\ test $ echo test my\ test/test.txt $ python Exception Exception but yet...
1
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.