How to access ASP.Net

So I am working with raspberry pi and I need the local IP address for some processes, however when I try to get the IP address I only get the server IP address and not the IP address of the local machine. I tried using the method dns.GetHost() and the methods similar to that but those do not work. I found ways to do it by using the Request() method but I can only use those with ASP.Net. Is there a way to use ASP.Net in Epicor because adding the System.Web namespace does help.

I am not sure I follow, what does the Raspberry PI have to do with Epicor? Where are you trying to get the IP Address? I’m a little lost

Are you trying to call ERP Rest endpoints from a Pi? I am not sure how you are going to host the ERP Server on a Pi.

We are using the raspberry pi as a thin client and need to run Epicor off of them. Running Epicor is not an issue. The issue is that I need the IP address of the thin client for specific methods. Every time I do this I get the server IP address and not the thin client IP address.

public static string GetLocalIPAddress()
{
    var host = Dns.GetHostEntry(Dns.GetHostName());
    foreach (var ip in host.AddressList)
    {
        if (ip.AddressFamily == AddressFamily.InterNetwork)
        {
            return ip.ToString();
        }
    }
    throw new Exception("No network adapters with an IPv4 address in the system!");
}

This is the method I am using and I get the IP address of the server that I am remoting into. I would like to get the IP of the thin client that is doing the remoting. I was thinking there is a way to do this in ASP.Net but I am having trouble running it. If I use the Request() method then I get the compiler error that Request() does not exist in the current context even with the correct namespace of System.Web

You are using the Pi as an RDP thinclient? So it is accessing a Terminal Services farm? You are then trying to run code within the Epicor Client inside that RDP farm to try to get the IP of the Raspberry Pi? Is that accurate?

Yes that sounds about right

You can execute a PS script to do this with a little bit of pre-work.

Import-Module PSTerminalServices
$a = Get-TSCurrentSession | Select-Object
$b = $a.ClientIPAddress.IPAddressToString
$b

Returns the IP address in variable $b. Verified working on Terminal Services 2016

https://archive.codeplex.com/?p=psterminalservices ← Documentation
GitHub - imseandavis/PSTerminalServices: PowerShell Version of QAINSTA and QUERY SESSION - Glorified Cassia Wrapper Basically ← Actual Download

1 Like