Absent Member.
Absent Member.
1091 views

Using Visual Cobol to create Web Application

Jump to solution

[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.
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert
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.

View solution in original post

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert
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.

View solution in original post

0 Likes
Absent Member.
Absent Member.
Thats great Chris, many thanks.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.