consultancy chorley ASP.NET Server Side Scripting Wigan
Website Development Radcliffe

A Coder's Notes

Email :
bespoke invoice systems Standish Information Technology Advice Worsley
    development systems Ramsbottom
data manipulation Farnworth access databases Whitefield SQL connections Atherton
online accessible software Leyland software compatible Coppull

Get connected and Online Tottington
remote management Makerfield code and design Aspull

ASP.Net Writing to a Text File - 28/04/2011

Quite a simple one this, but I'm placing it here as a reminder to myself...

You need this at the top of your file...

<%@ Import Namespace = "System.IO" %>

So to create a file you'll need the "io" namespace - input output - thats anything to do with files as far as I can see. 

dim myfile as streamwriter
myfile = file.createtext(server.mappath("myfolder") & "myfile.txt")

Don't forget to close the file.  If you do forget then you'll not be able to do anything more with the file until the session timeouts occur.

Post A Comment

Name Comment
programming services specialist
Valid XHTML 1.0 Transitional