2

I want to know where my application is used.

Here is the code for getting the country name:

public string Country = RegionInfo.CurrentRegion.DisplayName;

Here is the code to get the timezone:

public void TimeStamp()
{
    TimeZone zone = TimeZone.CurrentTimeZone;
    // Demonstrate ToLocalTime and ToUniversalTime.
    DateTime local = zone.ToLocalTime(DateTime.Now);

    _TimeStamp = local.ToString();
}

I want to see if this works for other locations and IP addresses. I have tried to change my IP address using cyperghost, but nothing changed. I live in Denmark and the code above still shows "Denmark xx.xx.xx xx.xx.xx".

How can I test if this code actually works as I want it to?

Backs
  • 24,430
  • 5
  • 58
  • 85
Loc Dai Le
  • 1,661
  • 4
  • 35
  • 70

1 Answers1

2

TimeZone.CurrentTimeZone property returns information from your current PC. So, you can change your date and timezone and check: enter image description here

Backs
  • 24,430
  • 5
  • 58
  • 85