Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   Temporatry File Name (http://www.velocityreviews.com/forums/t784665-temporatry-file-name.html)

Thom Little 03-09-2005 05:04 AM

Temporatry File Name
 
I have just finished an ASP.NET application that needs one (the last)
remaining tweak. It writes two temporary files and then appends them to an
SMTP message.

ASP 3 had a function ...
GetTempName
.... to generate unique temporary filenames. Is there an easy standard way
to generate temporary file names in ASP.NET?

--
-- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
--




[MSFT] 03-09-2005 08:27 AM

RE: Temporatry File Name
 
Hello Thom,

There is no such a function in ASP.NET or .NET framework. I think we have
two options here:

1. Use COM interop and stick on GetTempName.
2. Use Random Class in .NET to generate random value and compose random
string.

Hope this help,

Luke


Lionel LASKE 03-09-2005 11:14 AM

Re: Temporatry File Name
 

See System.IO.Path.GetTempFileName function
(http://msdn.microsoft.com/library/de...enametopic.asp).
See an example on
http://www.dotnetjunkies.com/Tutoria...19526093D.dcik

Lionel.

"Thom Little" <thom@tlanet.net> a écrit dans le message de news:
e1k13VGJFHA.1860@TK2MSFTNGP15.phx.gbl...
>I have just finished an ASP.NET application that needs one (the last)
>remaining tweak. It writes two temporary files and then appends them to an
>SMTP message.
>
> ASP 3 had a function ...
> GetTempName
> ... to generate unique temporary filenames. Is there an easy standard way
> to generate temporary file names in ASP.NET?
>
> --
> -- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
> --
>
>
>




Thom Little 03-09-2005 01:07 PM

Re: Temporatry File Name
 
The answer for me was ...

string strNameXLS = Path.ChangeExtension ( Path.GetTempFileName( ),
"xls" );
StreamWriter swXLS = File.CreateText( strNameXLS );

Thank you both for helping me with the "final tweak".

--
-- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
--

"Lionel LASKE" <llaske@c2s.fr> wrote in message
news:ee7c9kJJFHA.2884@tk2msftngp13.phx.gbl...
>
> See System.IO.Path.GetTempFileName function
> (http://msdn.microsoft.com/library/de...enametopic.asp).
> See an example on
> http://www.dotnetjunkies.com/Tutoria...19526093D.dcik
>
> Lionel.





All times are GMT. The time now is 01:40 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.