Click here to Skip to main content
15,921,577 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: URL routing issue asp.net 4.0 Pin
jkirkerx19-Nov-11 19:44
professionaljkirkerx19-Nov-11 19:44 
QuestionI have some queires releated to DataCalendar Pin
Ostwal Aarti18-Nov-11 1:37
Ostwal Aarti18-Nov-11 1:37 
AnswerRe: I have some queires releated to DataCalendar Pin
Blue_Boy18-Nov-11 1:54
Blue_Boy18-Nov-11 1:54 
QuestionMultiple dll's Refrencing Asp.net Website Pin
vishnukamath17-Nov-11 20:14
vishnukamath17-Nov-11 20:14 
QuestionRe: Multiple dll's Refrencing Asp.net Website Pin
Pandya Anil17-Nov-11 22:25
Pandya Anil17-Nov-11 22:25 
AnswerRe: Multiple dll's Refrencing Asp.net Website Pin
Richard MacCutchan18-Nov-11 0:44
mveRichard MacCutchan18-Nov-11 0:44 
AnswerRe: Multiple dll's Refrencing Asp.net Website Pin
jkirkerx19-Nov-11 19:51
professionaljkirkerx19-Nov-11 19:51 
QuestionGet Regional Language settings. Pin
Mugdha_Aditya17-Nov-11 19:56
Mugdha_Aditya17-Nov-11 19:56 
Hello,

I wants to retrive regional language settings in my code. For that i used WMI.

I tried below code.
in page load : GetLoggedInUserCulture();

C#
private static CultureInfo GetLoggedInUserCulture()
{
    string folderName = string.Empty;
    string sID = GetWindowsLoggedInUserSID();
    object locale = Registry.Users.OpenSubKey(sID + @"\Control Panel\International").GetValue("Locale");
    int lCID = int.Parse(locale.ToString(), NumberStyles.HexNumber);
    CultureInfo ci = new CultureInfo(lCID);
    return ci;
}
private static string GetWindowsLoggedInUserSID()
{
    string userName = null;
    string sID = null;
    try
    {
        ManagementScope oMs = new ManagementScope();
        ObjectQuery oQuery = new ObjectQuery("Select UserName from Win32_ComputerSystem");
        ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs, oQuery);
        ManagementObjectCollection oReturnCollection = oSearcher.Get();
        ManagementClass mc = new ManagementClass(oMs, new ManagementPath("ServerBinding"), null);
        foreach (ManagementObject oReturn in oReturnCollection)
        {
              userName = oReturn["UserName"].ToString().ToLower();
        }

            userName = userName.Substring(userName.LastIndexOf(@"\") + 1);
            oQuery = new ObjectQuery("Select SID, Name from Win32_Account where Name = '" + userName + "'");
            oSearcher = new ManagementObjectSearcher(oMs, oQuery);
            oReturnCollection = oSearcher.Get();

            foreach (ManagementObject oReturn in oReturnCollection)
            {
                if (oReturn["SID"] != null)
                {
                    sID = oReturn["SID"].ToString();
                }
            }
    }
    catch (Exception)
    {
        throw;
    }
    return sID;
}



but oReturn["UserName"] and oReturn["SID"] return me null value. Frown | :(

Do i need to add anything in webconfig. or any thing else am missing.. please help me
AnswerRe: Get Regional Language settings. Pin
Bernhard Hiller18-Nov-11 0:59
Bernhard Hiller18-Nov-11 0:59 
AnswerRe: Get Regional Language settings. Pin
jkirkerx19-Nov-11 19:55
professionaljkirkerx19-Nov-11 19:55 
GeneralRe: Get Regional Language settings. Pin
Mugdha_Aditya20-Nov-11 17:38
Mugdha_Aditya20-Nov-11 17:38 
GeneralRe: Get Regional Language settings. Pin
jkirkerx20-Nov-11 18:16
professionaljkirkerx20-Nov-11 18:16 
GeneralRe: Get Regional Language settings. Pin
Mugdha_Aditya21-Nov-11 2:30
Mugdha_Aditya21-Nov-11 2:30 
GeneralRe: Get Regional Language settings. Pin
jkirkerx21-Nov-11 7:17
professionaljkirkerx21-Nov-11 7:17 
QuestionIs Visual Source Safe 2005 free? Pin
MaulikDusara17-Nov-11 19:56
MaulikDusara17-Nov-11 19:56 
AnswerRe: Is Visual Source Safe 2005 free? Pin
Pandya Anil17-Nov-11 22:31
Pandya Anil17-Nov-11 22:31 
AnswerRe: Is Visual Source Safe 2005 free? Pin
Bernhard Hiller18-Nov-11 1:25
Bernhard Hiller18-Nov-11 1:25 
Questionto run asp.net 4.0 web application on VS 2005 Pin
sk_ko17-Nov-11 17:36
sk_ko17-Nov-11 17:36 
AnswerRe: to run asp.net 4.0 web application on VS 2005 Pin
Dennis E White17-Nov-11 20:02
professionalDennis E White17-Nov-11 20:02 
Questionbuilt in login control with sqlserver Pin
MalarGayu17-Nov-11 16:22
MalarGayu17-Nov-11 16:22 
AnswerRe: built in login control with sqlserver Pin
Not Active17-Nov-11 17:21
mentorNot Active17-Nov-11 17:21 
QuestionDataGrid Control Pin
Lavitiz17-Nov-11 12:00
Lavitiz17-Nov-11 12:00 
AnswerRe: DataGrid Control Pin
Not Active17-Nov-11 12:08
mentorNot Active17-Nov-11 12:08 
GeneralRe: DataGrid Control Pin
Lavitiz17-Nov-11 12:18
Lavitiz17-Nov-11 12:18 
Questionproblem update data in web control Pin
rachel_m17-Nov-11 4:41
rachel_m17-Nov-11 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.