472,344 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,344 software developers and data experts.

Need help! Web-based LAN Scanner

Guys, im just a newbie here, i have a school project and its a web-based project that scans all Internet Protocol (IP) in a Local Area Network (LAN) and displays a green light image if the workstation is online and red light image if offline, this is my coding:
Expand|Select|Wrap|Line Numbers
  1. <% Response.Buffer = true %> 
  2. <% 
  3.     url = "192.168.0.1" 
  4.  
  5.     Set objWShell = CreateObject("WScript.Shell") 
  6.     Set objCmd = objWShell.Exec("ping " & url) 
  7.     strPResult = objCmd.StdOut.Readall() 
  8.     set objCmd = nothing: Set objWShell = nothing 
  9.  
  10.     strStatus = "offline"
  11.     if InStr(strPResult,"TTL=")>0 then strStatus = "online" 
  12.  
  13.     response.write url & " is " & strStatus 
  14.  
  15. %>
if the ip is offline then the output here is:
192.168.0.1 is offline
my question is... if there's any code that changes the value of 'strStatus' into image that is located in 'Images\offline.gif' ? Btw, im using ASP VBScript.

Thanks in advance guys.
Sep 25 '07 #1
2 1533
jhardman
3,406 Expert 2GB
ASP's output is generally just printing out HTML code. In your case you are printing out the word "offline" or "online" but you could just as easily print out any HTML code including an image tag. So why don't you say
Expand|Select|Wrap|Line Numbers
  1. strStatus = "<img src='...'>"
instead of
Expand|Select|Wrap|Line Numbers
  1. strStatus = "offline"
?

Jared
Sep 26 '07 #2
ASP's output is generally just printing out HTML code. In your case you are printing out the word "offline" or "online" but you could just as easily print out any HTML code including an image tag. So why don't you say
Expand|Select|Wrap|Line Numbers
  1. strStatus = "<img src='...'>"
instead of
Expand|Select|Wrap|Line Numbers
  1. strStatus = "offline"
?

Jared

Thanks, already tried it and it works!
Sep 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: John Flynn | last post by:
hi all i'm going to be quick i have an assignment due which i have no idea how to do. i work full time so i dont have the time to learn it and...
0
by: xunling | last post by:
i have a question about answering ..... this topic is "need help" what do i have to write at te topic line, !after i have klicked the "answer...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of...
4
by: Scott Holland | last post by:
HELP - Need to connect to DB2 database on AIX from NT server. Also AS/400 from NT Server -- I am experienced in ORACLE and a novice at DB2. ...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a...
2
by: bryan | last post by:
I have a situation that's pretty delicate that I need some help on. I've been stumped for awhile I just need some advice on the best possible...
10
by: L. R. Du Broff | last post by:
I own a small business. Need to track a few hundred pieces of rental equipment that can be in any of a few dozen locations. I'm an old-time C...
23
by: vinod.bhavnani | last post by:
Hello all, I need desperate help Here is the problem: My problem today is with multidimensional arrays. Lets say i have an array A this...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago)...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.