-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathType-C.wsf
89 lines (86 loc) · 2.21 KB
/
Type-C.wsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?xml version="1.0" encoding="utf-8" ?>
<!--
缺点:在XML不同区域内写两种不同语言的代码,难以管理。无法良好的进行语法高亮显示。JS内部分语法失效。
Disadvantages: Writing code in two different languages in different areas of XML is difficult to manage.
Syntax highlighting is not possible. Some syntax in JS is invalid.
-->
<package xmlns="http://schemas.microsoft.com/WindowsScriptHost">
<job id="alert_test">
<script language="VBScript">
<![CDATA[
Function vbMsgBox(prompt,buttons,title)
vbMsgBox = MsgBox(prompt,buttons,title)
End Function
Function vbInputBox(prompt,title,default)
vbInputBox = InputBox(prompt,title,default)
End Function
]]>
</script>
<script language="JScript">
<![CDATA[
var VbMsgBoxStyle = {
"vbOKOnly":0,
"vbOKCancel":1,
"vbAbortRetryIgnore":2,
"vbYesNoCancel":3,
"vbYesNo":4,
"vbRetryCancel":5,
"vbCritical":16,
"vbQuestion":32,
"vbExclamation":48,
"vbInformation":64,
"vbDefaultButton1":0,
"vbDefaultButton2":256,
"vbDefaultButton3":512,
"vbDefaultButton4":768,
"vbApplicationModal":0,
"vbSystemModal":4096,
"vbMsgBoxHelpButton":16384,
"vbMsgBoxSetForeground":65536,
"vbMsgBoxRight":524288,
"vbMsgBoxRtlReading":1048576
};
var VbMsgBoxResult = {
"vbOK":1,
"vbCancel":2,
"vbAbort":3,
"vbRetry":4,
"vbIgnore":5,
"vbYes":6,
"vbNo":7
};
function MsgBox(strText,nType,strTitle) {
strText = strText || ""
nType = nType || 0;
strTitle = strTitle || "";
return vbMsgBox(strText, nType, strTitle);
};
var alert = MsgBox;
function confirm(strText) {
return MsgBox(strText, VbMsgBoxStyle.vbQuestion | VbMsgBoxStyle.vbOKCancel) == VbMsgBoxResult.vbOK;
};
function InputBox(sPrompt,sTitle,sDefault) {
sPrompt = sPrompt || "";
sTitle = sTitle || "";
sDefault = sDefault || "";
return vbInputBox(sPrompt,sTitle,sDefault);
};
function prompt(sPrompt,sTitle,sDefault) {
return InputBox(sPrompt,sDefault,sTitle);
};
/**
* 测试代码
* Test Code
*/
var str = prompt("Enter your name");
if(str) {
var res = confirm("Are you " + str + "?");
if(res)
alert("Yes,you are " + str);
else
alert("No,you are not " + str);
}
]]>
</script>
</job>
</package>