WWW File Share
Not only a file-sharing server
  Home Download Purchase Contact Resource
WWW File Share Pro
  > Overview
  > Download
  > Purchase
  > FAQ
Plugin
  > Overview
  > Download
  > Developer's Guide
Developer's Guide
 
Lesson 4 - Command Line Parameters


Overview

In this lesson, you'll learn how to use command line parameters.

Step One - Modify setting.ini

You've already created a plugin - "First Plugin". Let's modify the setting file again:

Enable=True
StartFile=test.exe
ReturnFile=hello.htm

RunOnce=False
DisplayName=First Plugin
User=

Step Two - Create the start file and the return file

Now please download the file - "test.exe", save it into the directory "First Plugin". The file "test.exe" is a small application that will display the command line parameters to you. You may download the source code (in VB6) of "test.exe" to learn more about it.


Then type following code into "hello.htm".

<html>
<body bgcolor=#FFFFFF>
<form name="form1" method="get" >
Name: <input type="text" name="Name"><br>
Email: <input type="text" name="Email"><br>
<input type="submit" name="Submit" value="Submit"> </form>
</body>
</html>

Please note that the method of the form is "get", not "post". Because currently the plugin system doesn't support method "post".

Step Three - Test the plugin

Please run WWW File Share Pro and open a browser to visit "First Plugin" again.


Click on "First Plugin". This time you will see:


Please input the name and the email, then click "Submit". Now WWW File Share Pro will start test.exe and send what it gets from the browser to test.exe as the command line parameter.
("test.exe Name=Jack&Email=Jack@wfshome.com&Submit=Submit")



Step Four - "/Config" and "/About"

Please switch to the window of WWW File Share Pro. Go to the "Advanced" > "Plugins" panel. Select "First plugin" and then click "Config" and "About" to see what command line parameter test.exe will get.

  • If your plugin allows the administrator to config, please write your code to deal with the command line parameter "/Config".
  • If your plugin has a "About" window, please write your code to deal with the command line parameter "/About".
  • If the visitor (attacker) tries to send "/Config" or "/About" to your plugin via the browser, WWW File Share Pro will ignore the parameter.

Summary

At the conclusion of this lesson, you should be able to do the following:

  1. How to send parameters to your plugin via the browser.
  2. Write code to deal with command line parameter "/Config" and "/About".

< Lesson 3 | Index | Lesson 5>
 
Copyright © 2002- LionMax Software. All rights reserved.