Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.

Reply
Thread Tools

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

 
 
Trevor
Guest
Posts: n/a
 
      07-26-2004
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");

}
 
Reply With Quote
 
 
 
 
news
Guest
Posts: n/a
 
      07-26-2004
I solved this.

"Trevor" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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");
>
> }



 
Reply With Quote
 
 
 
 
IIT Guy
Guest
Posts: n/a
 
      05-22-2007
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-.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-23-2007

"IIT Guy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      05-07-2008
Personally, I think it is rather rude to expect readers to go visit your
external link just to see what your question is. If you post a question to a
newsgroup, wouldn't it be more polite to include the actual content in your
post?
Peter
"prabakar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Can you reple me the soltuion?
>
> From
> http://www.developmentnow.com/g/8_20...incorrect-.htm
>
> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"filename,directory name,or volume label syntax is incorrect." ERR The Web Microsoft Certification 1 08-17-2009 05:53 AM
DVD Verdict reviews: MADLAX: REALITY (VOLUME 7), STARSHIP OPERATORS: MEMORIES (VOLUME 2), and more! DVD Verdict DVD Video 0 04-20-2006 08:36 AM
DVD Verdict reviews: SPEED RACER: VOLUME 4, MERMAID FOREST: UNQUENCHABLE THIRST (VOLUME 3), and more! DVD Verdict DVD Video 0 04-13-2006 08:22 AM
DVD Verdict reviews: SAMURAI CHAMPLOO: VOLUME 3, NEW FIST OF THE NORTH STAR: WHEN A MAN CARRIES SORROW (VOLUME 3), and more! DVD Verdict DVD Video 2 08-04-2005 07:32 AM
DVD Verdict reviews: SAMURAI CHAMPLOO (VOLUME 2), CHRONO CRUSADE: THE DEVIL TO PAY (VOLUME 4), and more! DVD Verdict DVD Video 0 05-26-2005 08:12 AM



Advertisments