Query Network for Location - InfoPath Dev
in

InfoPath Dev

Query Network for Location

Last post 06-22-2011 12:46 AM by Patrick Halstead. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-16-2011 10:30 AM

    Query Network for Location

    I would like to query my network to see which subnet I am on, Im not exactly sure what I can query. How can I find out which network the user is attached to with qrules or dbxl.
    Filed under: ,
  • 06-20-2011 04:15 AM In reply to

    Re: Query Network for Location

    You can use this formula to get the location of the XSN that's currently open:

     substring-before(substring-after(/processing-instruction()[local-name() = "mso-infoPathSolution"], 'href="'), '"')

    would that be enough to help you extract out the information you need?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 06-20-2011 06:59 AM In reply to

    Re: Query Network for Location

    Im opening the document from Sharepoint though... So, I need a way to query some environment variable that would reflect what network they are currently on ideally. Everybody would be opening the document from the same location in sharepoint, so I dont think that would work..
  • 06-20-2011 09:42 AM In reply to

    Re: Query Network for Location

    qRules and DBXL do not have features to access network information, but will require additional code. 

    Most environment access will require full-trust, some things, like UserName can be done with domain trust when using Local Intranet zone. 

    If you can deal with the added inconvenience of a full-trust form, code can be used to access network information.  If machines have multiple connections, VPNs, wi-fi, etc., that may complicate determining exactly which route the access to your SharePoint site is taking.   The System.Net.NetworkInformation namespace has many classes for accessing details of the network configuration.

    Can you describe the problem you are trying to solve?  There may be other alternatives, as working off network information is not likely going to be totally foolproof.

  • 06-20-2011 09:57 AM In reply to

    Re: Query Network for Location

    The form I have created, uses logic to define the location of the user, and I have gotten it to utilize active directory for the default location based on the users group information, but if the user is travelling, or doing a report from another office, it should reflect that location. The only way I can think of doing it is querying the network properties.

  • 06-20-2011 05:25 PM In reply to

    Re: Query Network for Location

    Stupid quesiton, but why not just add a dropdown and ask the user to select the location?

    Patrick Halstead
    Project Manager at Qdabra
  • 06-21-2011 05:23 AM In reply to

    Re: Query Network for Location

    Yes, that will work as well... I  guess I was just seeing if I could read from environment variables or something.
  • 06-22-2011 12:46 AM In reply to

    Re: Query Network for Location

    You can but it requires Full Trust since system environment variables require elevated .NET permissions to read and InfoPathy is all about being a straighlaced domain-trust dude.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.