All Questions
Tagged with ip-address c#
372
questions
0
votes
1
answer
64
views
regex validation for multiple input formats from a single input
I have a situation where I should check for 2 different cases from one input. There is a validation function which validates for domain names and ipv4 and ipv6 address. Since I am accepting the ...
0
votes
0
answers
82
views
Why can't I bind a TCP socket to another IP address?
At customer's site, the following piece of code is working like a charm:
private IPEndPoint GetCurrentServerIpAddress()
{
...
return new IPEndPoint(IPAddress.Parse("192.168.13....
2
votes
1
answer
1k
views
How to allow CORS with IP address in ASP.NET Core Web API project?
I am using the ASP.NET Core Web API project I want to allow CORS policy with someone's IP address and I would like to allow IP address ranges. Using this CORS method this is allow CORS for everyone I ...
0
votes
1
answer
57
views
Default binding address for outgoing connections
On a system with multiple local IP addresses, it is possible to specify the "default" interface binding address for outgoing connections process-wide (C#, dotnet executable)?
Meaning: if the ...
-1
votes
1
answer
900
views
How to get Client Ip address or Client/user Machine name in aspx c#
I am using a login form where i want to get user/client ip address or user machine name. Now there are multiple solution provided on multiple platforms including stackoverflow and i have tried almost ...
2
votes
1
answer
73
views
What's the sense of "Binding" a Tcp socket?
While working with sockets, I have found following piece of code:
using System.Net.Sockets;
...
private Socket _socket;
...
_socket.Blocking = false;
_socket.Bind(GetCurrentServerIpAddress());
_socket....
0
votes
1
answer
421
views
set blank ip address or remove ip adddress
I want to set ip address, subnet, gateway & dns; there is no issue in setting up but once the ip address is applied i'm trying to delete the existing gateway, pref dns its not working.
I tried to ...
1
vote
2
answers
63
views
C# MSGraph SDK and ipNamedLocation
I've been working on C# app to amend the ipaddress/s of a Named Location in conditional access in AAD.
I can authenticate and return the request collection. For whatever reason I cant access the ...
0
votes
1
answer
232
views
IPAddress.TryParse Returns the Wrong Address
I have the following code
string addrStr = "010.000.000.010";
bool parsed = IPAddress.TryParse(addrStr,out IPAddress addr);
parse returns true but the returned IPAddress is 8.0.0.8
If I ...
0
votes
1
answer
227
views
In ASP.NET MVC can not get the DHCP assigned IP address of clients Which visits my website
Trying to access the clients ip address of another PC from my website build in ASP.NET MVC.
I have used the bellow properties of .NET but still it's sending the IP address of clients always 127.0.0.1 ...
3
votes
1
answer
4k
views
Get IP address from Android and IOS Device using .NET MAUI
I am trying to get IP address from android device using .NET MAUI. (Current android framework net6.0-android)
With the below code, I can get the IP with the first launch of the application. And it ...
1
vote
0
answers
782
views
.Net 6 Web API returning a wrong remote IP address through Apache proxy
I have a .Net 6 C# web API that needs to verify the client IP address in some controller methods to reinforce the security. The self-contained published application run as a local service on Linux and ...
1
vote
0
answers
388
views
How to detect if a user is using a local ip, vpn or a public ip?
I am new to MVC. I am trying to create a landing page where the users may use it to open specific websites. I want to detect whether the user is accessing it through a local iPad or through a VPN or ...
0
votes
0
answers
634
views
How can send a UDP broadcast to *any* wildcard IP address on the network?
I'm trying to send a UDP broadcast to any machine within my subnet. It works well when I specify the IP address (e.g. 192.168.0.19), but I need it to be generic (192.168.x.x). How can I do that?
I ...
2
votes
1
answer
1k
views
System.Net.IPAddress.Parse() converts (unwanted) IPv6 string to IPv4-mapped-to-IPv6-address
I am trying to parse a string of an ip-address to a System.Net.IPAddress.
var ip = IPAddress.Parse(iPAddressDefinition);
The string can be every IPv4 or every IPv6 address, i.e. 0.0.0.0 - 255.255.255....