|
Interesting. My appologies on that one as I didn't see it when I looked.
There are still others on the list that are not countries I guess I will just have to filter them out.
Appears there is an issue on 64bit machines.
string keyPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\";
RegistryKey countryKey = Registry.LocalMachine.OpenSubKey(keyPath);
countryKey = null
According to Process Monitor it's trying to access the following key which doesn't exist.
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Telephony\Country List
Also I have found that Servers usually don't have a modem so this registry key doesn't exist.
|
|
|
|
|
MrSmoofy wrote: According to Process Monitor it's trying to access the following key which doesn't exist.
Yes, in short Windows provides separate 32-bit and 64-bit entries. That's described here[^], as well as opening an alternate view.
MrSmoofy wrote: Also I have found that Servers usually don't have a modem so this registry key doesn't exist.
How about exporting the list once from an existing machine to XML or a text-file and use that? Sounds like a good candidate to put in the resources.
Bastard Programmer from Hell
|
|
|
|
|
I wish that was an option.
I've been mandated that we will not be in the business of maintaining the list ourselves. Making it XML does that we would then have to maintain that XML if and when countries change. Microsoft is already maintaining the list. We simply want access to that list.
If I could maintain my own list I would use the ISO list.
|
|
|
|
|
Ah, but you personally may be able to make a few bucks by offering an update service.
|
|
|
|
|
That goes back to it's been mandated that we are not in the business of maintaing a list or webservice providing the list.
Also where the application is installed won't always have internet access to access such a webservice.
|
|
|
|
|
|
Why would I reinvent the wheel. This already exists. It's not an option if the application is installed on servers that do not have access to these services.
|
|
|
|
|
MrSmoofy wrote: do not have access to these services
No Services involved, just send the client a floppy (or whatever ) for a small consideration and your boss is none the wiser.
|
|
|
|
|
Thanks, I'd like to keep my job.
|
|
|
|
|
|
MrSmoofy wrote: Also where the application is installed won't always have internet access to access such a webservice.
Someone forgot to think - did a "manager" describe these restrictions?
How would Microsoft be able to provide updates (aka maintain the list) on a server where there's no internet access? If you can't maintain it, they can't either.
Bastard Programmer from Hell
|
|
|
|
|
Through windows update services. Which would be received from an internal network update server.
So the server is maintained just not directly via the internet to microsoft it's maintained by a central internal update server where the customer controls what windows updates the companies computers get.
|
|
|
|
|
MrSmoofy wrote: So the server is maintained just not directly via the internet to microsoft it's maintained by a central internal update server where the customer controls what windows updates the companies computers get.
Generate the textfile from that server, and distribute it? That way you're not "maintaining" it, and still have it propagate to the rest of the network.
I still doubt that Windows Update actually ever touches that particular registry-key.
Bastard Programmer from Hell
|
|
|
|
|
MrSmoofy wrote: Microsoft is already maintaining the list. We simply want access to that list.
Microsoft provides the list, I doubt that they're adding/removing entries on every Windows update. I'd check that assumption before embarking on a voyage
If they do, then you won't be able to filter out non-countries, as they might add "New York" whenever they feel like it. You'd still need access to the ISO-list to verify whether the new entry is a country or not.
Bastard Programmer from Hell
|
|
|
|
|
I agree with you but those above me maintain that if MS has a list we should be able to use it. My hands are tied on that.
|
|
|
|
|
Technology nor Windows will change to fit the desire of management. They can have the static list that Microsoft provides, or provide their own.
..or they'll have to contact Microsoft and ask for a version that can update the country-list without an internet-connection. Aw, and it should notify your application whenever it downloads a new one.
My apologies for being rude, but this is the fastest way to explain that management is asking for something that's going to be hard to provide, and I think it's relative unfair that they demand something without consulting the expert (that's you) on whether it's possible or desireable.
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: Microsoft provides the list, I doubt that they're adding/removing entries on
every Windows update.
Can't speak to that list nor to the "every" part but I do know that windows updates change the timezone information. Not just actual hour changes but renaming zones, removing, adding, etc.
And it happens on a fairly regular basis as well although it isn't clear to me why it changes so often.
|
|
|
|
|
jschell wrote: And it happens on a fairly regular basis as well although it isn't clear to me why it changes so often
Geopolitics, countries die and are born constantly.
You got me curious on how you noticed the differences - you comparing registry-snapshots, or did you move from one zone to another during one of those updates?
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: You got me curious on how you noticed the differences
I needed to insure that a mapped (config) value continued to map against the windows timezones, regardless of how they changed.
So I checked the map against the last map I had. Every time it changed it would produce an error.
|
|
|
|
|
Cool, noted for the next time
Bastard Programmer from Hell
|
|
|
|
|
MrSmoofy wrote: maintain that XML if and when countries change
How often does this happen?
|
|
|
|
|
So what happens in your app when someone selected country 'X' in March 2011 and in April of 2012 country 'X' no longer appears at all in the list that you extract from Windows?
|
|
|
|
|
That's a very very good point thank you. Not sure why I didn't think of that. Maybe that will finally get my way and have the ISO data in a table.
Thanks!
|
|
|
|
|
According to this[^] site (with example code), you should be able to find the conutry names you're looking for in the System.Globalization namespace, using the RegionInfo class.
Will Rogers never met me.
|
|
|
|
|
I send web requests and read data web response:
using (Stream stream = response.GetResponseStream())
{
Data = new byte[response.ContentLength];
int offset = 0;
int count = (int)response.ContentLength;
int nBytes = 0;
int nTotalBytes = 0;
while ((nBytes = stream.Read(Data, offset, count)) > 0)
{
offset += nBytes;
count -= nBytes;
nTotalBytes += nBytes;
}
}
If internet connection is suddenyl down Read() function blocks forever.
Is there a way to avoid it using the same Read() method?
Чесноков
|
|
|
|