The first lesson is how to open a web page using VB programming:
Since it is to pave the way for making a simulator, I will not introduce other methods, but only introduce the simplest implementation using the webbrowser control (actually I haven't learned the other methods yet).
Now we start to enter the door of the simulator:
1. First open VB and create a new project.
2. Right-click on the toolbar and select Components (I am using the Chinese version of VB) or select the Project menu and click Components
3. Find Microsoft Internet Controls, select it in front, and then confirm it. You will see an additional earth-like icon on the toolbar. Our future implementation will all revolve around it.
4. Add a WebBrowser1 to Form1, and then add a command1 to Form1.
5. Add the following code to Form1:
'----------start-----------
Private Sub Command1_Click()
WebBrowser1.Navigate "25emuhome.xilubbs.com"
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "http://net2sky.yeah.net"
End Sub
'----------Finish-----------
6. Of course, it is a test. Click the run button. We can see that our webbrowser opens the homepage of the network family. Then click the button again, and our lovely webbrowser takes us to the simulation home BBS.
Okay, that’s it for now. Next time we’ll look at how to use webbrowser to submit a web page containing a username and password.