Ejemplo n.º 1
0
        private void 새메모ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var myForm = new TextMemo();

            myForm.Show();
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string procName = Process.GetCurrentProcess().ProcessName;

            Process[] procArray = Process.GetProcessesByName(procName);
            if (procArray.Length > 1)
            {
                MessageBox.Show("Error : 관리자 권한으로 실행되지 않았거나, 이미 실행중입니다.");
                Exit();
            }
            else
            {
            }

            if (File.Exists("C:\\Program Files\\SH Sticker\\data\\.ini"))
            {
                File.Delete("C:\\Program Files\\SH Sticker\\data\\.ini");

                if (File.Exists("C:\\Program Files\\SH Sticker\\data\\.txt"))
                {
                    File.Delete("C:\\Program Files\\SH Sticker\\data\\.txt");
                }
            }

            this.WindowState    = FormWindowState.Minimized;
            this.ShowIcon       = false; //작업표시줄에서 제거.
            notifyIcon1.Visible = true;  //트레이 아이콘을 표시한다.

            if (!Directory.Exists(PB_Path))
            {
                Directory.CreateDirectory(PB_Path);
                Directory.CreateDirectory(PB_Path + "\\data");
                Directory.CreateDirectory(PB_Path + "\\recycle");
            }
            else
            {
                try
                {
                    DirectoryInfo DIR = new DirectoryInfo(PB_Path + "\\data\\");
                    FileInfo[]    F   = DIR.GetFiles("*.ini", SearchOption.AllDirectories);
                    FileInfo[]    FT  = DIR.GetFiles("*.txt", SearchOption.AllDirectories);
                    int           co  = 0;
                    foreach (FileInfo file in F)
                    {
                        string   name  = file.Name.ToString();
                        string[] Fname = name.Split('.'); //파일이름
                        TextMemo frm2  = new TextMemo();

                        frm2.FNA  = Fname[0];
                        frm2.FNA2 = "1";

                        string TP1 = Decrypt("K", File.ReadAllText(PB_Path + "\\data\\" + FT[co]));//내용
                        frm2.FNA3 = TP1;

                        StringBuilder Ptext2 = new StringBuilder();
                        int           ret2   = GetPrivateProfileString("Section2", "BgColor", "", Ptext2, 2147483647, PB_Path + "\\data\\" + file); //색깔코드
                        frm2.FNA4 = Ptext2.ToString();

                        StringBuilder Ptext3 = new StringBuilder();
                        int           ret3   = GetPrivateProfileString("Section3", "title", "", Ptext3, 2147483647, PB_Path + "\\data\\" + file); //제목
                        string        TP2    = Decrypt("K", Ptext3.ToString());
                        frm2.FNA5 = TP2;

                        StringBuilder Ptext4 = new StringBuilder();
                        int           ret4   = GetPrivateProfileString("Section4", "Location", "", Ptext4, 2147483647, PB_Path + "\\data\\" + file); //위치정보
                        string        TP3    = Decrypt("K", Ptext4.ToString());
                        frm2.FAN6 = TP3;

                        StringBuilder Ptext5 = new StringBuilder();
                        int           ret5   = GetPrivateProfileString("Section5", "Size", "", Ptext5, 2147483647, PB_Path + "\\data\\" + file); //사이즈
                        frm2.FAN7 = Ptext5.ToString();

                        frm2.Show();
                        co++;
                    }
                    co = 0;
                }
                catch
                {
                    MessageBox.Show("Error");
                }
            }
        }
Ejemplo n.º 3
0
        //한 때 경로지정 기능이였음
        //folderBrowserDialog1.ShowDialog();
        //string Path = folderBrowserDialog1.SelectedPath;
        //PAT_Box1.Text = Path;
        private void NewM_Click(object sender, EventArgs e)
        {
            var myForm = new TextMemo();

            myForm.Show();
        }