Solved

Need to show user Windows Explorer

Posted on 2003-10-28
3
245 Views
Last Modified: 2012-08-13
Hi all,

I want whenever my web page load on user machine at that time, through FSO or any other way. i want to show user their hard disk information like windows explorer does..

waiting for your all kind response.

Sahdev
0
Comment
Question by:SahdevSingh
  • 2
3 Comments
 
LVL 1

Expert Comment

by:mr_brij
ID: 9639804
u mean like directories in c drive or the hard disk info .. like how much space used or left ??

if for the directory .. u have the fso.... for the usage will have to check
0
 
LVL 21

Accepted Solution

by:
ap_sajith earned 250 total points
ID: 9640320
Copy the code below and test it out yourself... Btw.. most of the text in there is french..

<html>
<head>
<title>Selection de repertoire</title>
<style type="text/css">
body {
 font-family : Tahoma;
 font-size : xx-small;
}
a, a:hover, a:active {
 font-family : Tahoma;
 font-size : xx-small;
}
div {
 font-family : Tahoma;
 font-size : xx-small;
 border : 1px solid #000000;
 padding : 5px;
}
</style>
<script language="JavaScript">

var FSO;
var sOut = "";
var nl = "<br>" + String.fromCharCode(13);
var ImgPath = "Img/";
var sImgFolder = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "folder.gif\"";
sImgFolder += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";
var sImgFolderUp = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "folder_up.gif\"";
sImgFolderUp += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";
var sImgDrive = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "drive.gif\"";
sImgDrive += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";
var sImgDriveA = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "drive_a.gif\"";
sImgDriveA += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";

var DisplayPath = "";

function replaceAll(inSTR, inTOK, inREP) {
 var s;
 s = inSTR + "";
 while (s.indexOf(inTOK) >= 0) {
  s = s.replace(inTOK, "§");
 };
 while (s.indexOf("§") >= 0) {
  s = s.replace("§", inREP);
 };
 return s;
};

function getQuery(inINDX){
 var queryString = location.search;
 if (queryString != "") {
  var data = queryString.slice(1,queryString.length);
  var aData = data.split("&");
  var aOut = aData[inINDX].split("=");
  return aOut[1];
 } else {
  return "NoData";
 }
};

function GetCurrentFolder() {
 return DisplayPath;
};

function GoToDrives() {
 DisplayPath = "";
 GetDrives();
};

function GoToFolder(inFOLDER) {
 DisplayPath = inFOLDER;
 GetFolders();
};

function GetFolders() {
 // Balayage Repertoires
 var rep, sRep, i, t;
 sOut = "";
 sOut += DisplayPath + "<br><br>";
 t = DisplayPath.substring(0, DisplayPath.length - 1);
 t = t.substring(0, t.lastIndexOf(String.fromCharCode(92)) + 1);
 if (t + "" != "") {
  sOut += sImgFolderUp + "<a href=\"javascript:GoToFolder('";
  sOut += replaceAll(t, String.fromCharCode(92), "\\\\") + "');\" border=\"0\">";
  sOut += "Repertoire Parent</a><br>";
 } else {
  sOut += sImgFolderUp + "<a href=\"javascript:GoToDrives();\" border=\"0\">";
  sOut += "Repertoire Parent</a><br>"
 }
 try {
  rep = FSO.GetFolder(DisplayPath);
  var rOK = true;
 }
 catch (e) {
  var rOK = false;
 }
 if (rOK) {
  sRep = new Enumerator(rep.SubFolders);
  if (sRep.atEnd()) {
   sOut += "&nbsp;&nbsp;&nbsp;Pas de sous-repertoires";
  } else {
   for (i = 0; !sRep.atEnd(); sRep.moveNext()) {
    sOut += sImgFolder + "<a href=\"javascript:GoToFolder('";
    sOut += replaceAll(sRep.item(), String.fromCharCode(92), "\\\\") + "\\\\');\" border=\"0\">";
    sOut += sRep.item() + "\\</a>" + nl;
   };
  }
 } else {
  sOut += "&nbsp;&nbsp;&nbsp;Pas de sous-repertoires";
 }
 document.getElementById("SRInterface").innerHTML = sOut;
}

function GetDrives() {
 // Balayage Disques
 var drv, i;
 sOut = "";
 sOut += "Poste de travail<br><br>";
 var drvGlo = new Enumerator(FSO.Drives);
 for (i = 0; !drvGlo.atEnd(); drvGlo.moveNext()) {
  drv = drvGlo.item();
  if (drv.DriveType == 2) {
   sOut += sImgDrive + "<a href=\"javascript:GoToFolder('";
   sOut += drv.DriveLetter + ":\\\\');\" border=\"0\">";
   sOut += drv.DriveLetter + ":\\</a>" + nl;
  } else if (drv.DriveType == 1) {
   sOut += sImgDriveA + "<a href=\"javascript:GoToFolder('";
   sOut += drv.DriveLetter + ":\\\\');\" border=\"0\">";
   sOut += drv.DriveLetter + ":\\</a>" + nl;
  }
 };
 document.getElementById("SRInterface").innerHTML = sOut;
};

function DoLoad() {
 var ActiveXOK;
 try {
  var FSOT = new ActiveXObject("Scripting.FileSystemObject");
  ActiveXOK = true;
 }
 catch (e) {
  ActiveXOK = false;
 }
 if (ActiveXOK) {
  FSOT = null;
  FSO = new ActiveXObject("Scripting.FileSystemObject");
  GetDrives();
 } else {
  var lf = "<br>" + String.fromCharCode(13);
  sOut = "";
  sOut += "Ce script est dedié Internet Explorer." + lf;
  sOut += "L'utilisation de ce script nécessite une configuration de la securite de votre navigateur." + lf;
  sOut += "Allez dans Menu Outils > Options Internet >";
  sOut += " Sécurité > Personnaliser le niveau > Contrôles ActiveX et plugins" + lf;
  sOut += "Authorisez l'utilisation des composants ActiveX."
  document.getElementById("SRInterface").innerHTML = sOut;
 }
};
</script>
</head>

<body onLoad="DoLoad();">
<div id="SRInterface"></div>
<br>
<br>
<a href="javascript:alert(GetCurrentFolder());" border="0">
Recuperer le repertoire en cours (javascript:GetCurrentFolder();)
</a>
</body>
</html>

Cheers!!
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9649373
why just grade b??. The above solution is exactly what you asked for!

Cheers!!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
EOF BOF error classic asp 8 48
how to hide hopscotch tour popup page reload? 2 80
SMS AddAttachment Protocol Error Classic ASP 10 43
Html Table looping 4 13
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question