No. The documentation on this is clear:
Returns a string representation of the value of this instance in registry format.
And
Return Value
Type:System.String
The value of thisGuid
, formatted by using the "D" format specifier as follows:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ToString()
for some other objects consults the locale formatter, but not Guid
unfortunately.
You could define an extension method for Guid
and use that instead:
public static class GuidExtensions
{
public static string ToMyString(this Guid guid)
{
return guid.ToString("N");
}
}
// elsewhere
Guid guid = /* ... */;
Console.WriteLine(guid.ToMyString());
But I suppose forgetting to call this would be just as easy as forgetting the "N"
so this may not be much of an improvement. (If you do go this route anyway, please think of a better name for the extension method than ToMyString()
:-))