Skip to main content

[Migrated content. Thread originally posted on 09 August 2011]

Hi All,

Just starting to use Visual Cobol to develop a web application and was wondering if any one knows of any websites that will show me how to code the following sort of things:- (understand it will be in VB or C#)

1) get browser type
2) get external ip address
3) etc etc

I need to do this thru the COBOL code not any HTML and pick it up on the FORM_LOAD as I need to write the results back to my database that I control from within the source program.

Thanks for any help.

Neil.

[Migrated content. Thread originally posted on 09 August 2011]

Hi All,

Just starting to use Visual Cobol to develop a web application and was wondering if any one knows of any websites that will show me how to code the following sort of things:- (understand it will be in VB or C#)

1) get browser type
2) get external ip address
3) etc etc

I need to do this thru the COBOL code not any HTML and pick it up on the FORM_LOAD as I need to write the results back to my database that I control from within the source program.

Thanks for any help.

Neil.
All of the information about the client of your web application can be found as properties of the ASP.NET Request object.

Most of the Browser properties including the name and version can be picked up from the HttpBrowserCapabilities class that is accessible through the Request.Browser Property.

User IP and Hostname can be picked up through Request also:


      $set ilusing"System.Web"
...

       01 BrowserType string.
       01 UserHostIP string. 
       01 UserHostName string.
       method-id Page_Load protected.
       local-storage section.
       procedure division using by value sender as object by value e as type EventArgs.
           set BrowserType to self::Request::Browser::Type
           set UserHostIP to self::Request::UserHostAddress
           set UserHostName to self::Request::UserHostName
           goback.           
       end method.


[Migrated content. Thread originally posted on 09 August 2011]

Hi All,

Just starting to use Visual Cobol to develop a web application and was wondering if any one knows of any websites that will show me how to code the following sort of things:- (understand it will be in VB or C#)

1) get browser type
2) get external ip address
3) etc etc

I need to do this thru the COBOL code not any HTML and pick it up on the FORM_LOAD as I need to write the results back to my database that I control from within the source program.

Thanks for any help.

Neil.
Thats great Chris, many thanks.