Пример #1
0
        private void Hakkimizda_Load(object sender, System.EventArgs e)
        {
            string path = "", ip, db, usr, pass, con;

            label3.Text = string.Format("v{0}", Utility.Versiyon);

            try
            {
                path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            }
            catch {; }


            path            = path.Replace("file:\\", "");
            Utility.AppPath = path;
            path           += "\\config.ini";


            //MessageBox.Show(path);

            System.IO.StreamReader sr = new System.IO.StreamReader(path);
            ip   = sr.ReadLine();
            db   = sr.ReadLine();
            usr  = sr.ReadLine();
            pass = sr.ReadLine();

            //MessageBox.Show(ip);

            object ob = sr.ReadLine();

            if (ob == null)
            {
                MessageBox.Show("config.ini  dosyasina çikiş şifresi koyulmamiş şifreyi ekleyip uygulamayi tekrar çaliştirin ");
                this.Close();
            }
            else
            {
                con                  = "data source=";
                con                 += ip;
                con                 += ";user id=";
                con                 += usr;
                con                 += ";password="******";database=" + db + ";";
                Utility.Engine       = new Engine(con);
                Utility.Engine.sifre = ob.ToString();
                Utility.Engine.path  = path;
                Zaman.ZamanKur();
            }


            label2.Text = "";
        }
Пример #2
0
 internal static void ZamanKur()
 {
     try
     {
         Zaman.SYSTEMTIME systemtime;
         string           str = ZamanGetir();
         systemtime.wYear         = Convert.ToUInt16(str.Substring(0, 4));
         systemtime.wMonth        = Convert.ToUInt16(str.Substring(5, 2));
         systemtime.wDayOfWeek    = 1;
         systemtime.wDay          = Convert.ToUInt16(str.Substring(8, 2));
         systemtime.wHour         = Convert.ToUInt16(str.Substring(11, 2));
         systemtime.wMinute       = Convert.ToUInt16(str.Substring(14, 2));
         systemtime.wSecond       = Convert.ToUInt16(str.Substring(0x11, 2));
         systemtime.wMilliseconds = 0;
         Zaman.SetLocalTime(ref systemtime);
     }
     catch (Exception)
     {
     }
 }