Jump to content

Tracking harddrive


T F Dean
 Share

Recommended Posts

The code to track hard drive in asp is :<html><body><script type = "text/javascript">Set fs=Server.CreateObject("Scripting.FileSystemObject")if fs.driveexists("c:") = true then Response.Write("Drive c: exists.")dim fs,d set d=fs.GetDrive("c:") Response.Write("The Serial Number is " & d.serialNumber)Else Response.Write("Drive c: does not exist.")End IfResponse.write("<br />")if fs.driveexists("g:") = true then Response.Write("Drive g: exists.")Else Response.Write("Drive g: does not exist.")End IfResponse.write("<br />")if fs.driveexists("y:") = true then Response.Write("Drive g: exists.")Else Response.Write("Drive y: does not exist.")End Ifset d=nothingset fs=nothing</script></body></html>Is there any way to track the drive through HTML ?Thanks for the help

Link to comment
Share on other sites

First, that code isn't correct. The script tag claims it is Javascript, but that is VBScript code. Second, no, you can't access the client's filesystem through Javascript. HTML wouldn't be able to do anything like that anyway, HTML is just for displaying things on the page, it contains no executable code. Plugins like Flash and Java have limited filesystem access. Just regular Javascript does not though.

Link to comment
Share on other sites

Thanks for the reply. The stated code is from the tutorial in ASP. I have tested the code and it works fine. . . I am designing a program in a cd using HTML. The LOCK PART of this program contains the serial number of the hard disk of a specific computer. When attempting to run the cd, the program in the cd will match the serial number of the hard disk, and then execute. This is possible in ASP. Since my program is not working through server, would it be possible to access the serial number of drive c: through DOM, HTML or any other way. Thanks

Link to comment
Share on other sites

If you're talking about this example:http://www.w3schools.com/asp/showfile.asp?...mo_serialnumbernote that there's no script tag indicating the code is Javascript, instead there are the ASP tags which your code doesn't have. Your code is telling the browser to execute the following piece of Javascript code, and the ASP example is telling the server to execute the following ASP code. The language in the ASP example isn't specified, so it uses the default ASP language which is apparently set up to be VBScript on that server.The results you see on that example page are for the hard drive on the server where the code is running, not your local machine.If you're writing an application to be distributed on a CD and run locally, things like HTML, Javascript, and ASP aren't the right tools. You'll be better served with an application language like C++, C#, or Java. Each of those has a way to embed a web browser control that you can use to show web content, but those languages are not bound by the same limitations as web scripting languages.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...