Forum: JavaScript |
Thema:
Re: FileOpenDialog per JavaScript |
Von:
Hannes Preishuber (
03.04.2003 12:28) |
mal probieren ...
function FileOpen(){
//Decide which directory in which to open CommDlg
DP=TDC1.dataURL;
if(DP=='')
DataPath=location.pathname.substr(1)
else
DataPath=DP.substring(0,DP.lastIndexOf('\\')
//Initialize CommDlg properties
CommonDialog1.DialogTitle="Select Data File";
CommonDialog1.Filter=
"Data File (*.dat)|*.dat|All Files (*.*)|*.*";
CommonDialog1.InitDir=DataPath;
//Open CommDlg
try{
CommonDialog1.ShowOpen();
}
//An Error has occured
catch (exception){
//Strip high word from error number
errnum=exception.number & 0xFFFF;
//Check if user has pressed Cancel
if(errnum==32755)
return
//Some other error, display Error Message
//and return
else{
alert('ERROR:\n\n'+exception.description);
return;
}
}
...continued...
-Hannes
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!