• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  •  Sign In
XenApp Developer Network

Get Client IP address and Client hostname using Citrix ICO SDK

The following example illustrates the use of methods and properties available to get  client network name and IP address information using Citrix ICO SDK

Description

It is possible to Client IP address using ICO SDK. There are couple of use cases where a published application may want to do some logic based on the clien IP address in that case developers can use "GetClientAddress" API to retrieve client IP address.

Code Snippet

Save the code below as icoexample.html and click on connect to server to run examples.
Please change value="10.2.248.105" in below code to your XenApp Server

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Client address example</title>

<script language="JavaScript">
    <!--
    function GetClientNetworkName(form)
    {
        form.netname.value = document.ICO1.GetClientNetworkName()
    }
    function GetAddrCnt(form)
    {
        form.addrcnt.value = document.ICO1.GetClientAddressCount()
    }
    function GetAddr(form)
    {
        form.addr.value = document.ICO1.GetClientAddress(0)
    }
    function MyStartup()
    {document.ICO1.Startup()
    }
    //-->
   </script>
</head>

<body onLoad="MyStartup()">
<h1>Client address example</h1>
<center>
<br>
<object
id="ICO1" classid="clsid:238F6F83-B8B4-11cf-8771-00A024541EE3" height=480 width=640>
<param name="Address" value="10.2.248.105">
</object>
<br>
</center>

<form name=results>
<center>
<table>
<tr><td>NetworkName:</td><td><input type=text name=netname
size=50></td></tr>
<tr><td>AddressCount:</td><td><input type=text name=addrcnt
size=5></td></tr>
<tr><td>Address:</td><td><input type=text name=addr size=50></td></
tr>
</table>
<input type=button value="Get network name"
onClick="GetClientNetworkName(this.form)"><br>
<input type=button value="Get address count"
onClick="GetAddrCnt(this.form)"><br>
<input type=button value="Get address"
onClick="GetAddr(this.form)"><br>
</center>
</form>
</body>
</html>

Disclaimer

These software applications are provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.

Tags

ica ica Delete
client ip client ip Delete
ico sdk ico sdk Delete
Enter tags to add to this page:
Please wait 
Looking for a tag? Just start typing.
Related Links