Programmers for Hire
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgrammers for Hire

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 9th, 2005, 01:20 PM
lionel84 lionel84 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 35 lionel84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 51 m 38 sec
Reputation Power: 4
Unhappy How do I design a browser to detect text file?

This fyp folder should be put in C:\Inetpub\wwwroot\
Keep this window open.

With the text file ap.txt at desktop
Click on it and press Control + C

C:\Inetpub\wwwroot\fyp\program.asp performs the 4 task

1. Extracts the text file contents from C:\Inetpub\wwwroot\ap.text
2. Insert into the table “tracking_info” of the database located at C:\Inetpub\wwwroot\database.mdb
3. Delete the text file located at C:\Inetpub\wwwroot\ap.text
4. The program. asp will auto refreshes in 10 seconds waiting for a new ap.txt to generate, have to physically press Control + V per 10 seconds in C:\Inetpub\wwwroot\fyp so that it can pick up the text file in order for program.asp to work.

Direct the internet explorer to http://localhost/fyp/program.asp

program.asp is as shown..


<HTML>
<HEAD>
<TITLE>Upload Text in progress</TITLE>


<SCRIPT TYPE=text/javascript>
// The time out value is set to be 10,000 milli-seconds (or 10 seconds)
setTimeout(' document.location=document.location' ,10000);
</SCRIPT>


<SCRIPT LANGUAGE="vbscript">
'set focus
Sub doFocus
opener.focus
self.focus
End Sub
</SCRIPT>

</HEAD>

<BODY onFocus="doFocus()" onLoad="self.focus()">

<%
dim objConn, bjFSO, objTextFile, strNextLine, fs, tfile, fso

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Provider = "Microsoft.Jet.OLEDB.4.0"
objConn.Open(Server.MapPath("database.mdb"))

set objFSO = createobject("scripting.filesystemobject")

set objTextFile = objFSO.OpenTextFile("C:\Inetpub\wwwroot\fyp\ap.txt",1)
do until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
arr = split(strNextLine," ** ")

dim sql
sql = "INSERT INTO tracking_info(ap_id, signal_strength, mobile_id, other_info) VALUES('" & arr(i) & "', '" & arr(i+1) & "', '" & arr(i+2) & "', '" & Now() &"')"

objConn.execute(sql)

loop

set fs=Server.CreateObject("Scripting.FileSystemObject")
set tfile=fs.CreateTextFile("C:\Inetpub\wwwroot\fyp\ap.txt",1)

tfile.WriteLine("")
tfile.close
set tfile=nothing
set fs=nothing

objConn.close

set objConn = nothing
set objFSO = nothing
set objTextFile = nothing


Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile "C:/Inetpub/wwwroot/fyp/ap.txt"
%>

<SCRIPT LANGUAGE="VBScript">
' refresh the navigation folder
opener.navFolderFromUpload "<%=request("strDir")%>","<%=request("txtBox")%>","<%=request("file")%>"
self.close
</SCRIPT>

</BODY>
</HTML>


Problem

Problem is whenever after 10 seconds there is no ap.txt in the C:\Inetput\wwwroot\fyp folder or there is nothing in the text file, the browser directs to error page where no auto-refreshing can be performed.

• Question about program.asp

How should I make program.asp redirect my browser to ANOTHER browser to display the messages "no text file detected or text file is empty”.

• How should I design the other browser?

How do I design the codes for this browser to display “no text file detected or text file is empty, it will keep refreshing until it detects the existence of the contents of ap.txt, and then redirect to program.asp to perform the functions. Anyone knows? Any references?
Attached Files
File Type: zip fyp.zip (25.8 KB, 107 views)
File Type: txt ap.txt (264 Bytes, 145 views)

Reply With Quote
  #2  
Old July 10th, 2005, 03:49 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,721 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 20 m 20 sec
Reputation Power: 1914
--moved to Programmers For Hire forum.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgrammers for Hire > How do I design a browser to detect text file?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT