Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

Question c#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ross_smith@csaa.com - 16 Feb 2008 14:38 GMT
Is it possible to replace a string path with a steam of some sort?
Here is an example: item.path = "filename.xxx" where you use some
method (streaming comes to mind) that allows me to actually stream the
file to item.path instead of having to write it out to the hard drive
first?
Nicholas Paldino [.NET/C# MVP] - 16 Feb 2008 15:51 GMT
Ross,

   How else are you going to get the file to the path?  You ^must^ write
the file to the hard drive in order to, as you put it "stream the file to
the path".

   You can't have a file on disk with a path without writing the file to
disk.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Is it possible to replace a string path with a steam of some sort?
> Here is an example: item.path = "filename.xxx" where you use some
> method (streaming comes to mind) that allows me to actually stream the
> file to item.path instead of having to write it out to the hard drive
> first?
ross_smith@csaa.com - 16 Feb 2008 17:40 GMT
Thanks for getting back to me.

I was hoping there was a way to wrap a memory stream (orf something)
around the process. So that the calling program would work as desired
but i could save the time it takes to write out and then read the file
again.

Thanks again.
Nicholas Paldino [.NET/C# MVP] - 16 Feb 2008 18:00 GMT
I see what you are saying.  There is no object representation for a path
(they are represented as strings) which would allow you to do this.  If the
method/property took a Stream, then that would be great, as you could pass
it any number of derivations of Stream which would give you the
characteristics that you want.  Unfortunately, it doesn't, so you will have
to resort to writing to a temp file or something of that nature and passing
that to your property.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Thanks for getting back to me.
>
[quoted text clipped - 4 lines]
>
> Thanks again.
ross_smith@csaa.com - 16 Feb 2008 22:38 GMT
Well, thanks anyway. Didn't think so but thought i would give it a
try. Never hurts to ask.

thanks
christery@gmail.com - 17 Feb 2008 00:08 GMT
On 16 Feb, 18:40, ross_sm...@csaa.com wrote:
> Thanks for getting back to me.
>
[quoted text clipped - 4 lines]
>
> Thanks again.

but

MemoryStream whatewer = new MemoryStream();
XmlTextWriter whateverXML = new XmlTextWriter(whatever,
Encoding.None);

normally goes

XmlTextWriter whateverXML = new XmlTextWriter(@"c:
\whatever.xml",Encoding.None);

its a ram drive ;)

//CY
christery@gmail.com - 16 Feb 2008 16:54 GMT
On 16 Feb, 15:38, ross_sm...@csaa.com wrote:
> Is it possible to replace a string path with a steam of some sort?
> Here is an example: item.path = "filename.xxx" where you use some
> method (streaming comes to mind) that allows me to actually stream the
> file to item.path instead of having to write it out to the hard drive
> first?

MemoryStream whatever = new MemoryStream(); comes to mind, the
question and cap might be a clearer..
Question c# in microsoft.public.dotnet.languages.csharp  is ...

プログラムすることは困難である

//CY

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.