Microsoft Small Basic
Program Listing:
Embed this in your website
<object id='sbapp' data='data:application/x-silverlight-2,' type='application/x-silverlight-2' width='640' height='480'> <param name='source' value='http://smallbasic.com/program/ClientBin/SBWeb.xap'/> <param name='onError' value='onSilverlightError' /> <param name='background' value='white' /> <param name='minRuntimeVersion' value='3.0.40624.0' /> <param name='autoUpgrade' value='true' /> <param name='initParams' value='programId=HLB306' /> </object>
GraphicsWindow
.
Title
=
"パスワード生成"
GraphicsWindow
.
Width
=
640
GraphicsWindow
.
Height
=
300
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
FontSize
=
16
GraphicsWindow
.
FontName
=
"メイリオ"
passmoji
=
"1=a;2=b;3=c;4=d;5=e;6=f;7=g;8=h;9=i;10=j;11=k;12=l;13=m;14=n;15=o;16=p;17=q;18=r;19=s;20=t;21=u;22=v;23=w;24=x;25=y;26=z;27=A;28=B;29=C;30=D;31=E;32=F;33=G;34=H;35=I;36=J;37=K;38=L;39=M;40=N;41=O;42=P;43=Q;44=R;45=S;46=T;47=U;48=V;49=W;50=X;51=Y;52=Z;53=0;54=1;55=2;56=3;57=4;58=5;59=6;60=7;61=8;62=9;63=+;64=-;65=/;66=!;67=#;68=_;69=^;70=*;71=@;72=~;"
GraphicsWindow
.
DrawText
(
1
,
1
,
"パスワードの文字数 8 12"
)
GraphicsWindow
.
DrawText
(
160
,
1
,
Text
.
GetCharacter
(
9745
)
)
GraphicsWindow
.
DrawText
(
212
,
1
,
Text
.
GetCharacter
(
9744
)
)
mojikazu
=
8
GraphicsWindow
.
DrawText
(
1
,
30
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
22
,
30
,
"数字が1文字以上混ざったパスワードを生成する"
)
jouken1
=
0
GraphicsWindow
.
DrawText
(
1
,
60
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
22
,
60
,
"記号「+-/!#_^*@~」が1文字以上混ざったパスワードを生成する"
)
jouken2
=
0
GraphicsWindow
.
DrawText
(
1
,
90
,
"パスワード生成数 1 2 3 4 5"
)
GraphicsWindow
.
DrawText
(
160
,
90
,
Text
.
GetCharacter
(
9745
)
)
GraphicsWindow
.
DrawText
(
160
+
55
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
2
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
3
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
4
,
90
,
Text
.
GetCharacter
(
9744
)
)
passseiseikazu
=
1
GraphicsWindow
.
MouseDown
=
mousedown
passsyuturyoku
[
1
]
=
Controls
.
AddTextBox
(
1
,
180
)
passsyuturyoku
[
2
]
=
Controls
.
AddTextBox
(
1
+
190
,
180
)
passsyuturyoku
[
3
]
=
Controls
.
AddTextBox
(
1
+
190
*
2
,
180
)
passsyuturyoku
[
4
]
=
Controls
.
AddTextBox
(
1
,
180
+
40
)
passsyuturyoku
[
5
]
=
Controls
.
AddTextBox
(
1
+
190
,
180
+
40
)
passseisei
=
Controls
.
AddButton
(
"パスワード生成"
,
1
,
120
)
Controls
.
ButtonClicked
=
passwordseisei
Sub
mousedown
mx
=
GraphicsWindow
.
MouseX
my
=
GraphicsWindow
.
MouseY
If
(
160
<=
mx
And
mx
<=
160
+
16
)
And
(
1
<=
my
And
my
<=
1
+
16
)
And
(
mojikazu
=
12
)
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
212
,
1
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
,
1
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
160
,
1
,
Text
.
GetCharacter
(
9745
)
)
GraphicsWindow
.
DrawText
(
212
,
1
,
Text
.
GetCharacter
(
9744
)
)
mojikazu
=
8
EndIf
If
(
212
<=
mx
And
mx
<=
212
+
16
)
And
(
1
<=
my
And
my
<=
1
+
16
)
And
(
mojikazu
=
8
)
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
212
,
1
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
,
1
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
160
,
1
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
212
,
1
,
Text
.
GetCharacter
(
9745
)
)
mojikazu
=
12
EndIf
If
(
1
<=
mx
And
mx
<=
22
)
And
(
30
<=
my
And
my
<=
46
)
Then
If
jouken1
=
0
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
1
,
30
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
1
,
30
,
Text
.
GetCharacter
(
9745
)
)
jouken1
=
1
Else
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
1
,
30
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
1
,
30
,
Text
.
GetCharacter
(
9744
)
)
jouken1
=
0
EndIf
EndIf
If
(
1
<=
mx
And
mx
<=
22
)
And
(
60
<=
my
And
my
<=
76
)
Then
If
jouken2
=
0
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
1
,
60
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
1
,
60
,
Text
.
GetCharacter
(
9745
)
)
jouken2
=
1
Else
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
1
,
60
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
1
,
60
,
Text
.
GetCharacter
(
9744
)
)
jouken2
=
0
EndIf
EndIf
If
(
160
<=
mx
And
mx
<=
160
+
16
)
And
(
90
<=
my
And
my
<=
90
+
16
)
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
160
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
55
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
2
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
3
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
4
,
90
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
160
,
90
,
Text
.
GetCharacter
(
9745
)
)
GraphicsWindow
.
DrawText
(
160
+
55
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
2
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
3
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
4
,
90
,
Text
.
GetCharacter
(
9744
)
)
passseiseikazu
=
1
EndIf
If
(
160
+
55
<=
mx
And
mx
<=
160
+
55
+
16
)
And
(
90
<=
my
And
my
<=
90
+
16
)
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
160
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
55
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
2
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
3
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
4
,
90
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
160
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
55
,
90
,
Text
.
GetCharacter
(
9745
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
2
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
3
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
4
,
90
,
Text
.
GetCharacter
(
9744
)
)
passseiseikazu
=
2
EndIf
If
(
160
+
53
*
2
<=
mx
And
mx
<=
160
+
53
*
2
+
16
)
And
(
90
<=
my
And
my
<=
90
+
16
)
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
160
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
55
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
2
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
3
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
4
,
90
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
160
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
55
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
2
,
90
,
Text
.
GetCharacter
(
9745
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
3
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
4
,
90
,
Text
.
GetCharacter
(
9744
)
)
passseiseikazu
=
3
EndIf
If
(
160
+
53
*
3
<=
mx
And
mx
<=
160
+
53
*
3
+
16
)
And
(
90
<=
my
And
my
<=
90
+
16
)
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
160
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
55
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
2
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
3
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
4
,
90
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
160
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
55
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
2
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
3
,
90
,
Text
.
GetCharacter
(
9745
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
4
,
90
,
Text
.
GetCharacter
(
9744
)
)
passseiseikazu
=
4
EndIf
If
(
160
+
53
*
4
<=
mx
And
mx
<=
160
+
53
*
4
+
16
)
And
(
90
<=
my
And
my
<=
90
+
16
)
Then
GraphicsWindow
.
BrushColor
=
"White"
GraphicsWindow
.
FillRectangle
(
160
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
55
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
2
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
3
,
90
,
16
,
16
)
GraphicsWindow
.
FillRectangle
(
160
+
53
*
4
,
90
,
16
,
16
)
GraphicsWindow
.
BrushColor
=
"black"
GraphicsWindow
.
DrawText
(
160
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
55
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
2
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
3
,
90
,
Text
.
GetCharacter
(
9744
)
)
GraphicsWindow
.
DrawText
(
160
+
53
*
4
,
90
,
Text
.
GetCharacter
(
9745
)
)
passseiseikazu
=
5
EndIf
EndSub
Sub
passwordseisei
For
x
=
1
To
passseiseikazu
If
jouken2
=
0
Then
loop1
:
For
i
=
1
To
mojikazu
passw
[
i
]
=
passmoji
[
Math
.
GetRandomNumber
(
62
)
]
EndFor
If
mojikazu
=
8
Then
password
[
x
]
=
passw
[
1
]
+
passw
[
2
]
+
passw
[
3
]
+
passw
[
4
]
+
passw
[
5
]
+
passw
[
6
]
+
passw
[
7
]
+
passw
[
8
]
Else
password
[
x
]
=
passw
[
1
]
+
passw
[
2
]
+
passw
[
3
]
+
passw
[
4
]
+
passw
[
5
]
+
passw
[
6
]
+
passw
[
7
]
+
passw
[
8
]
+
passw
[
9
]
+
passw
[
10
]
+
passw
[
11
]
+
passw
[
12
]
EndIf
If
jouken1
=
0
Then
Controls
.
SetTextBoxText
(
passsyuturyoku
[
x
]
,
password
[
x
]
)
EndIf
If
jouken1
=
1
Then
If
Text
.
IsSubText
(
password
[
x
]
,
"0"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"1"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"2"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"3"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"4"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"5"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"6"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"7"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"8"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"9"
)
Then
Controls
.
SetTextBoxText
(
passsyuturyoku
[
x
]
,
password
[
x
]
)
Else
Goto
loop1
EndIf
EndIf
EndIf
If
jouken2
=
1
Then
loop2
:
For
i
=
1
To
mojikazu
passw
[
i
]
=
passmoji
[
Math
.
GetRandomNumber
(
72
)
]
EndFor
If
mojikazu
=
8
Then
password
[
x
]
=
passw
[
1
]
+
passw
[
2
]
+
passw
[
3
]
+
passw
[
4
]
+
passw
[
5
]
+
passw
[
6
]
+
passw
[
7
]
+
passw
[
8
]
Else
password
[
x
]
=
passw
[
1
]
+
passw
[
2
]
+
passw
[
3
]
+
passw
[
4
]
+
passw
[
5
]
+
passw
[
6
]
+
passw
[
7
]
+
passw
[
8
]
+
passw
[
9
]
+
passw
[
10
]
+
passw
[
11
]
+
passw
[
12
]
EndIf
If
Text
.
IsSubText
(
password
[
x
]
,
"+"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"-"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"/"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"!"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"#"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"_"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"^"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"*"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"@"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"~"
)
Then
If
jouken1
=
0
Then
Controls
.
SetTextBoxText
(
passsyuturyoku
[
x
]
,
password
[
x
]
)
EndIf
If
jouken1
=
1
Then
If
Text
.
IsSubText
(
password
[
x
]
,
"0"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"1"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"2"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"3"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"4"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"5"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"6"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"7"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"8"
)
Or
Text
.
IsSubText
(
password
[
x
]
,
"9"
)
Then
Controls
.
SetTextBoxText
(
passsyuturyoku
[
x
]
,
password
[
x
]
)
Else
Goto
loop2
EndIf
EndIf
Else
Goto
loop2
EndIf
EndIf
EndFor
EndSub
Copyright (c) Microsoft Corporation. All rights reserved.