# VB写CGI的"粉基本问题"

Posted by CGI初学 on August 21, 1999 at 09:02:56:

各位CGI高手:
VB在CGI写作上应已成熟,但小弟买一本"CGI彻底研究",并DownLoad WebSite1.1.想试一试.但安装了WebSite 利用例子却会发生程式似乎死掉了.
经叫出 SourceCode 在vb6下.发现程式经Inter_main() 就跳出.是否因此使
例子的CGI有问题???? 可否帮帮忙!　谢谢
CGI初学者

Sub Main()
On Error GoTo ErrorHandler

If Trim$(Command$) = "" Then ' Interactive start
Inter_Main ' Call interactive main
Exit Sub ' Exit the program
End If

InitializeCGI ' Create the CGI environment

'===========
CGI_Main ' Execute the actual "script"
'===========

Cleanup:
Close #CGI_OutputFN
Exit Sub ' End the program
'------------
ErrorHandler:
Select Case Err ' Decode our "user defined" errors
Case ERR_NO_FIELD:
ErrorString = "Unknown form field"
Case Else:
ErrorString = Error$ ' Must be VB error
End Select

ErrorString = ErrorString & " (error #" & Err & ")"
On Error GoTo 0 ' Prevent recursion
ErrorHandler (Err) ' Generate HTTP error result
Resume Cleanup
'------------
End Sub

Sub Inter_Main()
End Sub

Follow Ups:

- Re: VB写CGI的"粉基本问题" dino 16:31:19 8/21/99 (0)
- Re: VB写CGI的 tommy 10:00:55 8/21/99 (1)
  - Re: VB写CGI的 dino 16:39:06 8/21/99 (0)