請告訴我如何從JavaScript退出退出(我的硬盤上運行它)當我使用if語句。後續的代碼不起作用:如何從腳本中使用的if else
if (fso.FileExists("C:\\EXT\\file.txt")) //check if there file in the folder
{
log.WriteLine(file_exist_time + " - file exists C:\\EXT\\ ");
}
else
{
log.WriteLine("There is no file in C:\\EXT\\");
function exit()
{
throw ('Script Exit');
}
}
非常感謝您!
爲什麼不直接在日誌調用後執行'throw'?現在你只需定義一個名爲'exit'的函數,但是你永遠不會調用它。 – 2012-04-20 07:40:58
「返回」是否工作? – Tobi 2012-04-20 07:40:59
扔('退出')不起作用。如果你把'return'在 – May12 2012-04-20 07:46:29