Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie + Create Text file for Loggin on the Server

Status
Not open for further replies.

fmrock

Programmer
Sep 5, 2006
510
US
Hey everyone, I am hoping you can help a newbie out. I have to work on a web app tomarrow that is done in asp.net (VB). I have never had to do any ASP.net but do VB and classic ASP all the time. The person who coded this app is no longer with the company and I need to go into the code and add the ability to create a text file on the server that logs some info.

I have searched google and found a few different ways to do this and was wondering if you could point me in the best directory.

I basicly want to check to see if the file exists, if it does.. append to that file. If it doenst, then create the file and start writing to it.

Also, the file where i need to place this logic is called default.aspx.vb. If i just update this file, will the new logic take effect, or do I need to compile? or reboot/restart IIS?

Any help would be great, hope these questions are not to novice.
 
So what methods have you found? I'm assuming you've found File.Exists for checking the files existence and that you've found an article that explain how to do this reading/writing.

As for publishing the application there are many methods depending on the current setup and the version of the framework you have.


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Most of what i found is using the streamwriter. Which i guess will create the file if it does not exist. Would this be the best way to acomplish this loggin?


Also, as far as publishing, I know its using the 2.0 framework, and is actually part of the DNN portal.... besides that not sure how to publish.
 
what do you mean "publish". There is a menu item in visual studio that allows you to publish a site to a directory, but if you need anything more than that you must be more specific.

ca8msm is right, use the File.Exists to see if a file is there, if it is not, use the 4guysfromrolla article to get this working correctly.

David Kuhn
 
What i mean my publish is, can i just edit the vb file and resave it, or do i need to do anything to make the changes take effect.

This is my first attempt at editing an asp.net page tomarrow, so just trying to do some research before hand.
 
In the full version of VS.NET i usually just click Build in the menu bar and in that is a Publish Web Site item. Click this and you are brought into a wizard.

If this is your first time doing this, you may want to look into some tutorials at 4guysfromrolla or asp.net.

David Kuhn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top