Visual Basic 6 Black Book:Deploying Your Program: Creating Setup Programs, Help Files, And Online Registration
function GetCookie (name)
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg) {
var end = document.cookie.indexOf (";", j);
if (end == -1)
end = document.cookie.length;
return unescape(document.cookie.substring(j, end));
}
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
var m1='';
var gifstr=GetCookie("UsrType");
if((gifstr!=0 ) && (gifstr!=null)) { m2=gifstr; }
document.write(m1+m2+m3);
Keyword
Title
Author
ISBN
Publisher
Imprint
Brief
Full
Advanced Search
Search Tips
Please Select
-----------
Components
Content Mgt
Certification
Databases
Enterprise Mgt
Fun/Games
Groupware
Hardware
IBM Redbooks
Intranet Dev
Middleware
Multimedia
Networks
OS
Prod Apps
Programming
Security
UI
Web Services
Webmaster
Y2K
-----------
New Titles
-----------
Free Archive
To access the contents, click the chapter and section titles.
Visual Basic 6 Black Book
(Publisher: The Coriolis Group)
Author(s): Steven Holzner
ISBN: 1576102831
Publication Date: 08/01/98
function isIE4()
{
return( navigator.appName.indexOf("Microsoft") != -1 && (navigator.appVersion.charAt(0)=='4') );
}
function bookMarkit()
{
var url="http://www.itknowledge.com/PSUser/EWBookMarks.html?url="+window.location+"&isbn=0";
parent.location.href=url;
//var win = window.open(url,"myitk");
//if(!isIE4())
// win.focus();
}
Search this book:
Previous
Table of Contents
Next
Building Online Help Into Your Application
The Testing Department is calling again. The companys software is changing too fast to keep up with creating new Help files and sending them out to users all the timewhat can we do? You suggest, how about some online Help files?
You can build support for online Help files into Visual Basic applications easily by using the Web browser control. Using that control, you can connect the users directly to the company Web site and let them view Help files in HTML format.
Lets see an example. Using the Visual Basic Application Wizard, create a new project named onlinehelp. When the Application Wizard asks about Internet connectivity, as shown in Figure 30.19, click the Yes option button and enter the Help Web page you want to display to the user as the startup page for the programs built-in Web browser, as also shown in that figure. Then complete building the application with the Application Wizard by clicking the Finish button.
Figure 30.19 Adding an online Help page to a Visual Basic application.
To make the applications Web browser look less like a browser and more like online Help, use the Visual Basic menu editor to move the Web Browser menu item from the View menu to the Help menu and change its caption to Online Help. In addition, remove all the controls from the frmBrowser form except for the Web browser control, brwWebBrowser. Finally, take all code out of the frmBrowser form except for this code, which displays the starting page when the user opens the browser:
Public StartingAddress As String
Private Sub Form_Load()
Me.Show
If Len(StartingAddress) > 0 Then
brwWebBrowser.Navigate StartingAddress
End If
End Sub
And thats itnow when the user selects the Online Help item in the Help menu, the Web browser appears and connects to the Help page youve selected online, as shown in Figure 30.20. Congratulationsnow youre supporting online Help in your application. The code for this example is located in the FrmBrowser folder on this books accompanying CD-ROM.
Figure 30.20 Supporting online Help in a Visual Basic application.
Creating Online User Registration
The Testing Department has sent an email. Isnt there some way to keep track of your applications users? How about adding online registration to your application? Hmm, you think, how does that work?
To let your applications users register their new purchase easily, you can add online registration to your program. When users click the Online Registration menu item in the Help menu, a dialog box appears asking them to enter their name and email address. When they do and click a button marked Register, the application connects to the Internet and sends the recorded information to you.
Well see how this works in the next few topics in this chapter, where we use the FTP protocol to upload user registrations directly to an FTP site. This example, the onlinereg application, lets the user select a menu item, Register Online, in the Help menu, and displays an online registration form, Form2, as shown in Figure 30.21. When users enter their name and email address in the registration form and click the button labeled Register, the program sends the data in that form to an FTP server.
Figure 30.21 The onlinereg applications online registration form.
Well write the code for the registration form, Form2, now. When users enter their name and email address and click the Register button, we start by writing that information out to a temporary file, along with the name of the application the users are registering, as well as the time and date:
Private Sub Command1_Click()
Open "c:\temp.dat" For Output As #1
Print #1, "Registering SuperDuperDataCrunch" & vbCrLf
Print #1, "Name: " & Text1.Text & vbCrLf
Print #1, "email: " & Text2.Text & vbCrLf
Print #1, "Time: " & Format(Now)
Close #1
...
End Sub
This code stores the user information to the temp.dat file, like this:
Registering SuperDuperDataCrunch
Name: steve
email: steve@steveco.com
Time: 5/5/99 10:02:23 AM
This is the data that we will upload to the FTP server in the next topic.
TIP: Note that the file name here, temp.dat, may well conflict with an existing file. To make sure that does not happen, you can use the Visual Basic GetTempName method to get a name for the temporary file in which to store the users registration data.
Previous
Table of Contents
Next
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.
Wyszukiwarka
Podobne podstrony:
1058 10631066 11066 1068treco wiedza artykuly szczegoly id 1066 konflikt reaguj1063 1Uzbrojenie ochronne z czasów bitwy pod Hastings, 1066więcej podobnych podstron