CSInet Control

    If you have trouble downloading the control, you can access it through the following link: www.singnet.com.sg/~kegoh/CSInet.CAB

Methods Of CSInet

Abort : For Canceling any connection of the MSInet

AddField (name as String, value as String):
For adding non-file fields, parameter "name" is the name of the field to be added while "value" is the value of the field

AddFile (name as String, value as String):
For adding file fields, parameter "name" is the name of the field to be added while "value" is the filename

ClearField : For Clearing the fields

ClearFile: For Clearing the files

Upload: To start uploading, will return a string containing the server response

Properties:

Password

Proxy

Url

Username

Using the CSInet

Assuming that you wish to do the equivalent of the following HTML code:

<FORM action=page1.asp encType=multipart/form-data method=post name=DisplayForm>

<INPUT type="file" id=file1 name=filename>

<INPUT type="file" id=file2 name=filename2>

<INPUT type="name" id=text1 name=text1><INPUT type="submit" value="Submit" id=submit1 name=submit1>

</FORM>

     In VB, you would need to add the CSInet Control into your application. Assuming that you have named the CSInet control as CSControl1, you will need the following codes:

'Set Action Url
CSControl1.Url = "http://155.69.60.185/page1.asp"
'Clear non-file fields
CSControl1.clearfield

'Clear files
CSControl1.clearfile

'Add non-file field
CSControl1.Addfield "name", "test"

'Add first file
CSControl1.Addfile "filename", "C:\file1.doc"

'Add second file
CSControl1.Addfile "filename2", "C:\file2.exe"

'Close any MSInet connection that may still be excuting
CSControl1.abort
RespondStr=CSControl1.Upload
   'RespondStr contain the response from the web server