Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

VB6 - Viewer

$
0
0
I used dilettante's Gossamer Web Server control to make an image viewer. The viewer is actually your browser, so in theory it will deliver anything that your browser will support; pictures, HTML, movies etc.

It is designed to run as a service using the NT Service Control, but will also run as a Desktop application. As provided, it runs as a Desktop application. To create the Service program, change the IsService flag to true and compile. To add it as a service, run the service program from the command prompt with a "/I" argument. If successful, a message "Viewer Service installed successfully." will display. To Uninstall it, use the "/U" argument. The Service Manager (services.msc) can then be used to start or stop the service. If you want to allow access from the Local Area Network (LAN), or the Wide Area Network (WAN), you will have to adjust your Firewall.

The Service logs service related functions to a date named file in the \Windows\System32\Logfiles\Misc directory. You should create this directory to utilize the Service function. Unlike the Desktop version, which logs individual access to the text box, the Service as provided does not log access.

As provided, the program uses a default Web page called "Default.htm" in the same directory as the executable. To access it, direct your browser to "localhost:8080". That web page will list 3 sub directories (HTML PAGES, PNG PICTURES, JPEG PICTURES). Simply click on one of them to access a listing of the available items. Clicking on one of them will display the particular item. To view another one, simply use the "Back" button on your browser.

The viewable items are located in 3 sub directories (\pages, \pngs, & \jpgs). I have provided a few samples as a separate download. The web page used to access these files is created automatically when it is selected from the default page. You do not have to manually add files to the HTML page. Simply copy your favorite images/pages to the appropriate directory. It is suggested that you change the name of the file to provide some meaning as to it's content, rather than generic names such as "Image(123).png". Web pages are not exactly my forte, so if there is a better way of doing this, I am all ears. I also anticipate that if wide access to these files is to be provided, some sort of limitation on the creation of the HTML pages will have to be provided for. Other than that potential problem, the speed of response on a local network seems very good.

I wanted to store the parameters in the registry, but the socket software is initialized in the User Control, which occurs before the form itself is run. I suppose the registry could be accessed from the User Control, but that will have to wait for a later version.

J.A. Coutts

Edit: The images would not upload. I suspect that it is too large. I will adjust them and upload later.
Attached Images
 
Attached Files

Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>