T F Dean Posted March 21, 2011 Share Posted March 21, 2011 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 More sharing options...
justsomeguy Posted March 21, 2011 Share Posted March 21, 2011 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 More sharing options...
T F Dean Posted March 23, 2011 Author Share Posted March 23, 2011 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 More sharing options...
justsomeguy Posted March 23, 2011 Share Posted March 23, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.