Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Temporatry File Name

Reply
Thread Tools

Temporatry File Name

 
 
Thom Little
Guest
Posts: n/a
 
      03-09-2005
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.
--



 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      03-09-2005
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

 
Reply With Quote
 
 
 
 
Lionel LASKE
Guest
Posts: n/a
 
      03-09-2005

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" <(E-Mail Removed)> a écrit dans le message de news:
http://www.velocityreviews.com/forums/(E-Mail Removed)...
>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.
> --
>
>
>



 
Reply With Quote
 
Thom Little
Guest
Posts: n/a
 
      03-09-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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.



 
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
adding a variable name to a hash to name is part of the variable name Bobby Chamness Perl 2 04-22-2007 09:54 PM
print("my name is {name}, and {age}-year old {gender}", name, age, gender); =?iso-8859-1?B?bW9vcJk=?= Java 7 01-02-2006 04:39 PM
IE name="name" & form.name property bug Java script Dude Javascript 5 06-30-2004 03:07 AM
name = name.substring(0, name.lastIndexOf('.')); Help please Jack-2 Javascript 3 12-24-2003 04:39 PM
Re: Urgent! how to get object name, method name and attribute name based on the strings? ding feng C++ 2 06-25-2003 01:18 PM



Advertisments