I would like to know how can I open a textfile from other website like www.website.com/jhon.txt.?
I want to open it in my default.asp, without remove my banners and buttons and all my Images, Im just want to open it in the middle of my asp page. How can I do that?
I cannot append to a textfile. This is my sample code:
set f=Server.CreateObject("Scripting.FileSystemObject") set obj_log .CreateTextFile"C:loglog.txt",true) obj_log.WriteLine("Added schedule by [Name]") f.close obj_log.close Set obj_log=Nothing Set f=Nothing
The problem is the next time i execute these lines from an asp page, it does not append in a new line. I cannot figure out how.It just keep on overwriting.
i need a asp script out there for a guestbook. all the form input will be stored to a normal txt file, not a database. anyone have any links out there for this ? i have found a couple, but got errors when setting them up and it's been the script, not the server.
I cannot use the OpenTextFile method, it's never return and I get no error message! Setting Response.Buffer=False, has no effect. No matter if I use it ForReading or ForWriting, it never return. In the following code, the problem occurs at line 3.
aFileName = Server.MapPath("WEB_PROD.htm") set fs = server.CreateObject("Scripting.FileSystemObject") set fso = fs.OpenTextFile(aFileName, ForReading, False) s = ts.ReadAll ts.Close set ts = nothing Response.Write s
I am currently writing a script for a course i am doing, It lists all the files and folders on the server, and works similar to windows explorer ( if you click on the folder it shows the content ). I have enabled it so you can delete, view source, and download all files/folders.
Now theres one more thing i would like to do, and that is to enable the user to edit a file, and i am struggling quite a bit, any guidance, ideas or links to a similar tutorial. I am probably going about it completley the wrong way, I was trying to open the file read each line and write it into a textarea, so the user could edit it, and then save it.
With the following code I can create a new textfile if it does not exist, but it seems impossible to me, to append data to an existing file.
Dim objOpenFile, objFSO, strPath StrPath = Server.MapPath("../smslog.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(StrPath) Then Set objOpenFile = objFSO.OpenTextFile(StrPath, ForAppending) Else Set objOpenFile = objFSO.CreateTextFile(StrPath, True) objOpenFile.WriteLine "KundNr;Namn;Datum;Tid" 'header End if .. .. what I have done wrong?
I'm trying to make a text file search that will read a text file looking for the string the user typed in, then if it finds the string i want it to display all the information on that line then continue it's search through the rest of the file repeating the previous step if needed.
What i've got so far is it reading the text file in and it can search for a particular string(word, name etc) and say whether or not its in the file, but i don't know how to get it to display the whole line of information and continue it's search.
I'm pretty new to webprogramming. I use VWD 2008 Express Edition. I try to build a webpage and the content of that page is stored in a textfile on the filesystem. That way I can change the content of my webpage very easy. The problem is that I can't figure out how to show the content of that textfile in my browser.