Re: File Size

"Shawn Wildermuth (MVP)" <[email protected]> Mon, 23 Jul 2007 21:36:20 -0400
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <[email protected]>
How doesn't it work?  (error, compile?  What?)

Thanks,

Shawn Wildermuth
http://adoguy.com
http://wildermuthconsulting.com
Microsoft MVP (C#), MCSD.NET, Author and Speaker


-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:[email protected]] On Behalf Of Andrew Dunn
Sent: Monday, July 23, 2007 9:34 PM
To: [email protected]
Subject: Re: [DOTNET-WEB] File Size

Ok thank you,

How do you check the size of a file in a memory stream?

I tried this? But doesn't work.

MemoryStream Strm = new MemoryStream();
BaseImg.Save(Strm,ImageFormat.Jpeg);
lblFileSize.Text = "File Size: " + FormatSize(Strm.Length);

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:[email protected]] On Behalf Of Shawn Wildermuth
(MVP)
Sent: Tuesday, 24 July 2007 11:16 AM
To: [email protected]
Subject: Re: [DOTNET-WEB] File Size

You could save it to a MemoryStream and check the size...not very
efficient
but it works.

Thanks,

Shawn Wildermuth
http://adoguy.com
http://wildermuthconsulting.com
Microsoft MVP (C#), MCSD.NET, Author and Speaker


-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:[email protected]] On Behalf Of Andrew Dunn
Sent: Monday, July 23, 2007 9:12 PM
To: [email protected]
Subject: [DOTNET-WEB] File Size

Hi,

I have an image in a Bitmap object. Does anyone know if it is possible
to get a size of the file stored in memory (without saving it to disk)?

Thank you

Andrew

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com