Create a temp file with VB.NET
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Computer Science Clay
Active In SP

Posts: 712
Joined: Jan 2009
01-03-2009, 10:51 AM

Temp files are generally used for temporary storage and data manipulation. This is often necessary for storing user data, user preferences, session information, application cache, and many other types of information.

In order to get the name of the file that you can use as a temp file in VB.NET, I suggest using the GetTempFileName method of the Path class. While there are multiple approaches to creating a temp file, it's really helpful to use the System.IO.Path because it returns a unique file name in the current user's temporary directory; you can use that file name to create a file for storing temporary information. Note that calling this method multiple times will result in getting a different file name each time even if you don't use that name to create a file. This behavior prevents name collisions between multiple applications.

In my sample code, I define the string variable, sTempFileName, and assign the System.IO.Path.GetTempFileName method's return value to it. This produces a temp file name that I can use. I then create a FileStream object, fsTemp, and request that the system create a file with the filename, sTempFileName. Once the file is created, I add data to it (this code is omitted in the example). After that, the temp file is closed.

Code: [Select]
Private Sub TempFile()
Dim sTempFileName AsString = System.IO.Path.GetTempFileName()
Dim fsTemp AsNew System.IO.FileStream(sTempFileName, IO.FileMode.Create)


'write data to the temp file



End Sub
Use Search at wisely To Get Information About Project Topic and Seminar ideas with report/source code along pdf and ppt presenaion

Important Note..!

If you are not satisfied with above reply ,..Please


So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Tagged Pages: examples of seminar topics in vb net, upload file temp vb net, seminar topics related to vb net application, seminar topic on vb net, how to create temp file in vb net, how to create excel sheet and with temprory name using vb net, how to search a temporary file using vb net source code,
Popular Searches: project report how to create a webpage, net warp baler, ob vis net loc es, create bit notice, gsm based temp contoller project, how to create project on online banking in net, ito substrate temp resistance pdf,

Quick Reply
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Load Rebalancing for Distributed File Systems in Clouds seminar tips 3 1,769 13-04-2015, 05:21 PM
Last Post: shilpavpius
  crime file management system er diagram jaseelati 0 415 17-01-2015, 04:35 PM
Last Post: jaseelati
  crime file management system ppt jaseelati 0 210 27-12-2014, 01:17 PM
Last Post: jaseelati
  Calling a Web Service from an ASP.NET Web Page ppt study tips 1 513 19-10-2014, 11:24 PM
Last Post: LICjKYTCf
  Andrew File System (seminar or presentation ppt) project poster 1 650 01-11-2013, 03:46 PM
Last Post: fizamalik
  Information Theoretic Framework of Trust Modeling and Evaluation for Ad Hoc Net seminar projects maker 0 394 30-09-2013, 04:22 PM
Last Post: seminar projects maker
  Visual Basic .NET File IO Primer seminar projects maker 0 396 14-09-2013, 01:50 PM
Last Post: seminar projects maker
Last Post: study tips
  Introduction to Visual Studio.NET ppt study tips 0 305 30-08-2013, 03:12 PM
Last Post: study tips
  NET Framework seminar tips 7 3,707 21-08-2013, 09:17 AM
Last Post: study tips