web中如何运用commondialog control?200分 (100分)

  • 主题发起人 主题发起人 limestone
  • 开始时间 开始时间
L

limestone

Unregistered / Unconfirmed
GUEST, unregistred user!
附code:
高手看一下有什么错误,
<HTML>
<HEAD>
<TITLE>Some Page</TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Button1_OnClick
on error resume next
objComDlg.Filename = ""
objComDlg.Filter = "Microsoft Word Format (*.doc)|*.doc|Rich Text Format (*.rtf)|*.rtf|Hypertext Markup Language "
objComDlg.Filter = objComDlg.Filter &amp
"(*.htm, *.html)|*.htm;*html|Text Documents (*.txt)|*.txt"
objComDlg.ShowOpen
if err.number = 0 then
If UCase(Right(objComDlg.FileName, 3)) = "DOC" Then
objTX.Load objComDlg.Filename,0,9,0
elseIf UCase(Right(objComDlg.FileName, 3)) = "RTF" Then
objTX.Load objComDlg.Filename,0,5,0
elseIf UCase(Right(objComDlg.FileName, 3)) = "HTM" or UCase(Right(objComDlg.FileName, 4)) = "HTML" Then
objTX.Load objComDlg.Filename,0,4,0
else
objTX.Load objComDlg.Filename,0,1,0
end if
end if
End Sub

-->
</SCRIPT>

</HEAD>
<BODY>

<FORM>
<INPUT NAME="Button1" TYPE="BUTTON" VALUE="Load file...">
</FORM>

<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
<PARAM NAME="LPKPath" VALUE="comdlg.lpk">
</OBJECT>

<OBJECT ID="CommonDialog1" WIDTH=32 HEIGHT=32
CLASSID="CLSID:F9043C85-F6F2-101A-A3C9-08002B2F49FB"
CODEBASE="http://activex.microsoft.com/controls/vb5/comdlg32.cab">
</OBJECT>

</BODY>
</HTML>

 
HTML>
<HEAD>
<TITLE>Some Page</TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Button1_OnClick
on error resume next
objComDlg.Filename = ""
objComDlg.Filter = "Microsoft Word Format (*.doc)|*.doc|Rich Text Format (*.rtf)|*.rtf|Hypertext Markup Language "
objComDlg.Filter = objComDlg.Filter &amp
"(*.htm, *.html)|*.htm;*html|Text Documents (*.txt)|*.txt"
objComDlg.ShowOpen
if err.number = 0 then
If UCase(Right(objComDlg.FileName, 3)) = "DOC" Then
objTX.Load objComDlg.Filename,0,9,0
elseIf UCase(Right(objComDlg.FileName, 3)) = "RTF" Then
objTX.Load objComDlg.Filename,0,5,0
elseIf UCase(Right(objComDlg.FileName, 3)) = "HTM" or UCase(Right(objComDlg.FileName, 4)) = "HTML" Then
objTX.Load objComDlg.Filename,0,4,0
else
objTX.Load objComDlg.Filename,0,1,0
end if
end if
End Sub

-->
</SCRIPT>

</HEAD>
<BODY>

<FORM>
<INPUT NAME="Button1" TYPE="BUTTON" VALUE="Load file..." [blue]onclick="javascript: Button1_OnClick"[/blue]>
</FORM>

<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
<PARAM NAME="LPKPath" VALUE="comdlg.lpk">
</OBJECT>
//这个对象是作什么用的?"Microsoft Licensed Class Manager 1.0",是上面的objTX?

<OBJECT ID="[blue]objComDlg[/blue]" WIDTH=32 HEIGHT=32
CLASSID="CLSID:F9043C85-F6F2-101A-A3C9-08002B2F49FB"
CODEBASE="http://activex.microsoft.com/controls/vb5/comdlg32.cab">
</OBJECT>

</BODY>
</HTML>
 
完全正确
 
后退
顶部