Example #1
0
        public frmMain()
        {
            var LangDlg = new frmLanguageSelection();

            LangDlg.ShowDialog();
            LanguageSupport.Language = LangDlg.UseDefault ? LanguageSupport.GetNativeLanguage() : LangDlg.SelectedLanguage == 0 ? "Turkish" : "English";
            this.InitializeComponent();
        }
        public bool GetAccountInformations()
        {
            bool              Result;
            UInt32            Count = 0;
            LiveIdInformation Info  = new LiveIdInformation();

            LangMgr = new LanguageSupport();
            IntPtr BufPtr = IntPtr.Zero;

            NativeWin32API.CREDENTIAL CurrentCredential;

            if (IsSuccess)
            {
                return(true);
            }


            Result = NativeWin32API.CredEnumerate("WindowsLive:name=*", 0, out Count, out CredentialPtr);

            if (Result)
            {
                LiveAccounts = new List <LiveIdInformation>((int)Count);

                BufPtr = CredentialPtr;

                for (int i = 0; i < Count; i++)
                {
                    BufPtr = new IntPtr(BufPtr.ToInt32() + ((i == 0) ? 0  : Marshal.SizeOf(CredentialPtr)));


                    CurrentCredential = (NativeWin32API.CREDENTIAL)Marshal.PtrToStructure(Marshal.ReadIntPtr(BufPtr), typeof(NativeWin32API.CREDENTIAL));

                    Info.LiveId = CurrentCredential.UserName;


                    Info.Password = Marshal.PtrToStringUni(CurrentCredential.CredentialBlob);

                    int LngIndex = System.Globalization.CultureInfo.CurrentCulture.Parent.NativeName == "English"? 1 : 0;

                    if (Info.Password == null)
                    {
                        Info.Password = LangMgr["PwdNotSet"];
                    }
                    LiveAccounts.Add(Info);
                }

                IsSuccess = true;
            }

            return(Result);
        }
        public bool GetAccountInformations()
        {
            bool Result;
            UInt32 Count=0;
            LiveIdInformation Info = new LiveIdInformation();
            LangMgr = new LanguageSupport();
            IntPtr BufPtr = IntPtr.Zero;
            NativeWin32API.CREDENTIAL CurrentCredential;

            if (IsSuccess)
                return true;

            Result = NativeWin32API.CredEnumerate("WindowsLive:name=*",0,out Count,out CredentialPtr);

            if (Result)
            {
                LiveAccounts = new List<LiveIdInformation>((int)Count);

                BufPtr = CredentialPtr;

                for (int i = 0; i < Count; i++)
                {

                    BufPtr = new IntPtr(BufPtr.ToInt32() + ((i == 0) ? 0  : Marshal.SizeOf(CredentialPtr)));

                    CurrentCredential = (NativeWin32API.CREDENTIAL)Marshal.PtrToStructure(Marshal.ReadIntPtr(BufPtr),typeof(NativeWin32API.CREDENTIAL));

                    Info.LiveId = CurrentCredential.UserName;

                    Info.Password = Marshal.PtrToStringUni(CurrentCredential.CredentialBlob);

                    int LngIndex = System.Globalization.CultureInfo.CurrentCulture.Parent.NativeName == "English"? 1 : 0;

                    if (Info.Password == null)
                        Info.Password = LangMgr["PwdNotSet"];
                    LiveAccounts.Add(Info);
                }

                IsSuccess = true;
            }

            return Result;
        }
Example #4
0
        public frmMain()
        {
            DialogResult Chooise   = DialogResult.None;
            string       WantToUse = "";

            frmLanguageSelection LangDlg = new frmLanguageSelection();

            LangDlg.ShowDialog();

            if (LangDlg.UseDefault)
            {
                LanguageSupport.Language = LanguageSupport.GetNativeLanguage();
            }
            else
            {
                LanguageSupport.Language = LangDlg.SelectedLanguage == 0 ? "Turkish" : "English";
            }



            InitializeComponent();
        }