Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stream path not supported
Message
 
À
11/03/2009 12:46:15
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Divers
Thread ID:
01387152
Message ID:
01387156
Vues:
49
>Hi all,
>
>I am trying to use a FileStream to write out a record. I had this working but today out of the blue with a different path it won't work. I keep getting "The given path's format is not supported". What is wrong with these paths I have tried.
>
>
>FileStream stream = null;
>try
>{
>     stream = File.Create(saveName);
>     XmlSerializer xml = new XmlSerializer(record.GetType());
>     xml.Serialize(stream, record);
>}
>
>where "saveName" is equal to
>"C:\\DevelopCSharp\\Pacifica.Tracker\\TrackerClient\\Database\\SpotQueue\\Spot_3-11-2009(15:49:59).xml"
>or since I thought the Pacifica.Tracker with a period in it might be the problem
>"C:\\DevelopCSharp\\TrackerClientTemp\\Database\SpotQueue\\Spot_3-11-2009(15:49:59).xml"
>
>None of this works. The file name with the time in parens was working for weeks, the only thing that changed was the app directory.
>
>Any ideas?
>Tim

Can you post the code where you assing the path to the string variable saveName?
are you using something like this
string saveName = @"C:\DevelopCSharp\TrackerClientTemp\Database\SpotQueue\Spot_3-11-2009(15:49:59).xml";
Then you don't have to mess with the double slash
If you are not using the @ then you do have to use the double slash and I noticed that you are missing a double slash in your path.

Also take a look at the System.IO.Path class, which is very useful when working with paths and filenames.
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform