1. 분류
자산 : 현재총 소유 재산관련
부채 : 기타잡비, 소비, 공과비, 교통비, 감가상각비
자본 : 저축관련, 보험관련

2. 대차대조표
3. 손익계산서

------------------
세우 DATA - 7월7일

부채 : 스카이라이프 17만원, 소정이 계 23만원, 통신비(8만원, 소정이갚아야함)
         48만원
Posted by penguindori
1. 메인 화면
2. 기능 수행 화면
3. 메인에서 기능 수행 화면 회전시 보기 안좋은 화면 가리기용 Loding 화면

이 필요합니다.(TEST 환경)

main

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms;

namespace Motion
{
    public partial class Form1 : Form
    {
        public Form1()
        { 

            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            LoadForm90 lform = new LoadForm90();
            lform.Show();
            lform.Refresh();
           
            SystemSettings.ScreenOrientation = ScreenOrientation.Angle90;

            subForm subform = new subForm(lform);
            subform.ShowDialog();
            subform.Close();
            subform = null;
           
            LoadForm0 lform2 = new LoadForm0();
            lform2.Show();
            lform2.Refresh();

            SystemSettings.ScreenOrientation = ScreenOrientation.Angle0;
           
            lform2.Close();
            lform2.Dispose();
            lform2 = null;
            GC.Collect();
        }
    }
}


Load form 들은 생성자에만 아래와 같이 구현
 public LoadForm90()
 {
    InitializeComponent();
    this.Refresh();
    Application.DoEvents();
 }

subForm

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Motion
{
    public partial class subForm : Form
    {
        LoadForm90 sform;
        public subForm(LoadForm90 sforms)
        {
            sform = sforms;
            InitializeComponent();
        }

        private void subForm_Load(object sender, EventArgs e)
        {
            if (sform != null)
            {
                sform.Close();
                sform.Dispose();
                sform = null;
            }
        }
    }
}



버튼을 클릭하면 우선 노란색으로 변한뒤에 화면이 회전한다

그 후에 노란색 화면이 사라지면서 내용이 보여진다
Posted by penguindori
카테고리 없음2009. 6. 30. 14:26

// This code example demonstrates the String.Format() method.

// Formatting for this example uses the "en-US" culture.

 

using System;

class Sample

{

    enum Color { Yellow = 1, Blue, Green };

    static DateTime thisDate = DateTime.Now;

 

    public static void Main()

    {

        // Store the output of the String.Format method in a string.

        string s = "";

 

        Console.Clear();

 

        // Format a negative integer or floating-point number in various ways.

        Console.WriteLine("Standard Numeric Format Specifiers");

        s = String.Format(

            "(C) Currency: . . . . . . . . {0:C}\n" +

            "(D) Decimal:. . . . . . . . . {0:D}\n" +

            "(E) Scientific: . . . . . . . {1:E}\n" +

            "(F) Fixed point:. . . . . . . {1:F}\n" +

            "(G) General:. . . . . . . . . {0:G}\n" +

            "    (default):. . . . . . . . {0} (default = 'G')\n" +

            "(N) Number: . . . . . . . . . {0:N}\n" +

            "(P) Percent:. . . . . . . . . {1:P}\n" +

            "(R) Round-trip: . . . . . . . {1:R}\n" +

            "(X) Hexadecimal:. . . . . . . {0:X}\n",

            -123, -123.45f);

        Console.WriteLine(s);

 

        // Format the current date in various ways.

        Console.WriteLine("Standard DateTime Format Specifiers");

        s = String.Format(

            "(d) Short date: . . . . . . . {0:d}\n" +

            "(D) Long date:. . . . . . . . {0:D}\n" +

            "(t) Short time: . . . . . . . {0:t}\n" +

            "(T) Long time:. . . . . . . . {0:T}\n" +

            "(f) Full date/short time: . . {0:f}\n" +

            "(F) Full date/long time:. . . {0:F}\n" +

            "(g) General date/short time:. {0:g}\n" +

            "(G) General date/long time: . {0:G}\n" +

            "    (default):. . . . . . . . {0} (default = 'G')\n" +

            "(M) Month:. . . . . . . . . . {0:M}\n" +

            "(R) RFC1123:. . . . . . . . . {0:R}\n" +

            "(s) Sortable: . . . . . . . . {0:s}\n" +

            "(u) Universal sortable: . . . {0:u} (invariant)\n" +

            "(U) Universal sortable: . . . {0:U}\n" +

            "(Y) Year: . . . . . . . . . . {0:Y}\n",

            thisDate);

        Console.WriteLine(s);

 

        // Format a Color enumeration value in various ways.

        Console.WriteLine("Standard Enumeration Format Specifiers");

        s = String.Format(

            "(G) General:. . . . . . . . . {0:G}\n" +

            "    (default):. . . . . . . . {0} (default = 'G')\n" +

            "(F) Flags:. . . . . . . . . . {0:F} (flags or integer)\n" +

            "(D) Decimal number: . . . . . {0:D}\n" +

            "(X) Hexadecimal:. . . . . . . {0:X}\n",

            Color.Green);

        Console.WriteLine(s);

    }

}

/*

This code example produces the following results:

 

Standard Numeric Format Specifiers

(C) Currency: . . . . . . . . ($123.00)

(D) Decimal:. . . . . . . . . -123

(E) Scientific: . . . . . . . -1.234500E+002

(F) Fixed point:. . . . . . . -123.45

(G) General:. . . . . . . . . -123

    (default):. . . . . . . . -123 (default = 'G')

(N) Number: . . . . . . . . . -123.00

(P) Percent:. . . . . . . . . -12,345.00 %

(R) Round-trip: . . . . . . . -123.45

(X) Hexadecimal:. . . . . . . FFFFFF85

 

Standard DateTime Format Specifiers

(d) Short date: . . . . . . . 6/26/2004

(D) Long date:. . . . . . . . Saturday, June 26, 2004

(t) Short time: . . . . . . . 8:11 PM

(T) Long time:. . . . . . . . 8:11:04 PM

(f) Full date/short time: . . Saturday, June 26, 2004 8:11 PM

(F) Full date/long time:. . . Saturday, June 26, 2004 8:11:04 PM

(g) General date/short time:. 6/26/2004 8:11 PM

(G) General date/long time: . 6/26/2004 8:11:04 PM

    (default):. . . . . . . . 6/26/2004 8:11:04 PM (default = 'G')

(M) Month:. . . . . . . . . . June 26

(R) RFC1123:. . . . . . . . . Sat, 26 Jun 2004 20:11:04 GMT

(s) Sortable: . . . . . . . . 2004-06-26T20:11:04

(u) Universal sortable: . . . 2004-06-26 20:11:04Z (invariant)

(U) Universal sortable: . . . Sunday, June 27, 2004 3:11:04 AM

(Y) Year: . . . . . . . . . . June, 2004

Standard Enumeration Format Specifiers

(G) General:. . . . . . . . . Green

    (default):. . . . . . . . Green (default = 'G')

(F) Flags:. . . . . . . . . . Green (flags or integer)

(D) Decimal number: . . . . . 3

(X) Hexadecimal:. . . . . . . 00000003

*/

이게 전부인거 같아요. 한번 실행해 보시고... 판단해야할거 같네요


Posted by penguindori
Common C#/C# BEST TIP2009. 6. 20. 19:24

1. DateTime.DaysInMonth(int Year , int Month)

2.
string DateString = "2007-12-26 11:29:34.537";
        DateTime nt = DateTime.Parse(DateString.Substring(0,7) + "-01");
        nt = nt.AddMonths(1).AddDays(-1);         
        this.Text = nt.ToString("yyyy-MM-dd");

Posted by penguindori
Story : 이거 땜에 스트레스 받아서 환장 했다. ㅎ-ㅎ-ㅎ-ㅎ-;;

 인터넷 접속을 통한 자동 접속 방법 1 [using System.Net;]
           
            WebRequest webreq;
            WebResponse webres;
            string url = "http://www.msn.com";

            webreq = System.Net.WebRequest.Create(url);

            bool success = false;
            try
            {
                webres = webreq.GetResponse();
                webreq.Abort();
                success = true;
            }
            catch(Exception er) {}


그리고 요청 사항이였던 이넘 ;;

OpenNETCF <-- 설치해야 한다.
http://opennetcf.com/ 에서 다운 받으면 됨

        private void typeConnection(string typeName)
        { 
            DestinationInfoCollection DIC = connMgr.EnumDestinations();
            try
            {
                foreach (DestinationInfo di in DIC)
                {
                    if (di.Description == "The Internet") // (di.Description == typeName)
                    {
                        connMgr.Connect(di.Guid, true, ConnectionMode.Asynchronous);
                    }
                }
            }
            catch (Exception er)
            {
                MessageBox.Show(er.ToString());
            }
       }

            AdapterCollection adapters = Networking.GetAdapters();

            foreach (Adapter adapter in adapters)
            {
                int ras = adapter.Name.IndexOf("RAS VPN");
                int activeSync = adapter.Name.IndexOf("Serial on USB");
                // Check if this is a GPRS/GSM/CDMA adapter
                if ((ras == -1) && (activeSync == -1) && (adapter.Type == AdapterType.PPP) && (!adapter.IsWireless))
                {
                    GPRSIPAddress = adapter.CurrentIpAddress;
                }

                ConnectionManager connMgr = new ConnectionManager();
                DestinationInfoCollection destInfoColl = connMgr.EnumDestinations();

                bool connected = false;
                foreach (DestinationInfo destInfo in destInfoColl)
                {
                    if (destInfo.Description == "Gprs connection")
                    {
                        connMgr.Connect(destInfo.Guid, true, ConnectionMode.Asynchronous);
                        while (!connected)
                        {
                            if (connMgr.Status != ConnectionStatus.Connected)
                            {
                                System.Threading.Thread.Sleep(1000);
                                continue;
                            }
                            connected = true;
                        }
                        break;
                    }
                }


            }
        }

피곤해서 색깔은 다음에 칠하자 ㅡㅡ;






Posted by penguindori
Common Mobile/WinCE Mobile2009. 5. 28. 11:04
1. 관련 소스

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms; //SystemSettings NameSpace

namespace Screen2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           textBox1.Text = "화면 방향 :" + SystemSettings.ScreenOrientation.ToString();
            textBox2.Text = "화면 해상도" + Screen.PrimaryScreen.Bounds.Width + "x" +
                                   Screen.PrimaryScreen.Bounds.Height;
            if (SystemSettings.ScreenOrientation == ScreenOrientation.Angle90)
            {
                SystemSettings.ScreenOrientation = ScreenOrientation.Angle0;
            }
            else
            {
                SystemSettings.ScreenOrientation = ScreenOrientation.Angle90;
            }
        }
    }
}


2. UI 관련

0. Base : Panel
    => 기본적으로 폼 위에 Panel을 올리고 속성에서 Dock : Fill
1. 화면 전환 : Button
    => 속성에서 Dock : Top 

2. textBox1 : 화면 각도 표시
    => 속성에서 Dock : Top 

3. 하나,둘... : Grid
    => 속성에서 Dock : Top 

4. textBox2 : 해상도 표시
    => 속성에서 Dock : Bottom

=> Result
http://windowsmobile7.tistory.com/5 [참조]
Posted by penguindori

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;

namespace MobileGlass7.HiCommon
{
    sealed class ActiveSyncState
    {
       // RegistryKey SyncState;

        internal string GetState
        {
            get
            {
                string value;

                if (!Registry.LocalMachine.OpenSubKey(@"System\State\HardWare").Equals(null))
                    value = Registry.LocalMachine.OpenSubKey(@"System\State\HardWare").GetValue("Cradled").ToString();
                else
                    value = "";
                return value;
            }
        }
     }
}
----------------------------------------------------------------------------------------------------------------
<META http-equiv="Content-Type"> <META content="DEXTWebEditor" name="GENERATOR">

안녕하세요.

 

PDA가 PC에 연결된 크래들에 꼽히고 싱크가 정상적으로 되면 Event를 받는 부분을 몰라..

2일째 질문&답변을 참조하였습니다.

 

그 결과... 아래 함수를 알수 있었습니다.

CeRunAppAtEvent();

그러나 위 API함수는 이벤트가 발생할때 특정 프로그램을(*.exe)파일을 실행시켜 주는 것 같았습니다.

 

또 다른 방법은 Register의 Flag 상태를 체크하여 Active Sync가 되었는지, 되지 않았는지 체크 하는 방법도 있었습니다.

(가능하다는 글만 봤지, 자세히 기재된 내용을 찾아 보기 힘들었습니다.)

제가 해보고 싶은것은 Register의 Flag값을 참조하여 Active연결 상태를 검사하는 부분을 구현하고 싶습니다.

 

하지만,

Active Sync가 정상적으로 된 후, PDA의 어느쪽 Register값을 참조해야 하는지 모르겠습니다.

 

윽~~~

지금 부지런히 레지스터 트리 검색하고 있는데 찾기가 힘드네요..

좀 알려주시면 감사하겠습니다.

 

 

이 글에 평점 주기:  
 [답변][re]참고해보세요.. 2008-07-30 오후 3:08:52
지태성 (nix30)   번호: 28137   / 평점:  (-)  
<META http-equiv="Content-Type"> <META content="DEXTWebEditor" name="GENERATOR">

다음의 registry 값을 확인해 보시면 됩니다.

"HKLM\System\State\Hardware\Cradled", 크래들이 연결되면 값이 1로 변경이 됩니다.

다만, 위 registry 값은 Windows Mobile 5.0 부터 지원되는 것으로 알고 있으니, 님께서 사용하고 계시는 단말기의 OS 버전을 확인해 보신 후 사용해 보시기 바랍니다.

 

참고해 보시기 바랍니다.

감사합니다.

 

이 글에 평점 주기:  
         [답변]에구~ 찾아봐도 없습니다.ㅠ.ㅠ 2008-08-03 오후 10:15:34
김수종 (wowhul)   번호: 28153   / 평점:  (-)  
<META http-equiv="Content-Type"> <META content="DEXTWebEditor" name="GENERATOR">

우선 답변 대단히 감사합니다.

 

말씀 하신 OS버젼의 문제인것 같습니다.

제가 개발하고 있는 PDA는 산업용 PDA로써 Windows CE 5.0입니다.

꼭 생긴게 Windows 95폼이랑 비슷합니다.^^

어떻게 생긴 OS버젼인지 아시죠^^

 

근데 알려주신 레지스터와 그 부근을 모두 싹 찾아 봤지만, Cradle에 관련된 레지스터는

아직도 못 찾았습니다. ㅠ.ㅠ

어디에 숨어 있는지 너무 너무~~ 궁금합니다.

알려주시면 대단히 감사하겠습니다.

 

 

 

 

이 글에 평점 주기:  
                 [답변][re]참고해보세요.. 2008-08-04 오전 9:49:31
지태성 (nix30)   번호: 28158   / 평점:  (-)  
<META http-equiv="Content-Type"> <META content="DEXTWebEditor" name="GENERATOR">

제가 알려드린 Registry 값은 Windows Mobile 5.0 부터 지원되는 Registry 값으로. Windows CE 5.0에서는 지원되지 않습니다. 아무래도 다른 방법을 찾아 보셔야 할 것 같습니다.

 

다른 하나의 방법이라면, 현재 PDA에서 사용하고 있는 IP를 체크하는 방법입니다. 현재, 정확한 IP 주소가 생각나지는 않지만, ActiveSync가 연결되면 고정적인 IP 주소를 할당받게됩니다. 한 번, 참조해 보세요.

 

참고해 보시기 바랍니다.

감사합니다.

 

 

이 글에 평점 주기:  
                         [답변]친절한 답변 대댠히 감사합니다. 2008-08-04 오후 4:49:07
김수종 (wowhul)   번호: 28168   / 평점:  (-)  
<META http-equiv="Content-Type"> <META content="DEXTWebEditor" name="GENERATOR">

해당 레지스터를 찾지 못하여

다른 방법으로 해결을 햇습니다.

 

1. FindWindow()

2. IP주소 확인

 

위 두단계를 거쳐 원하는 부분을 구현하였습니다.

 

다시 감사합니다.


Posted by penguindori
Common C#/C# BEST TIP2009. 5. 20. 15:20

frm.ShowDialog를 하시기 전에
frm.FormClosing  이나 frm.FormClosed 이벤트 핸들러를 등록하시면
폼이 닫히는것을 감지하여 핸들러 메소드가 실행되게 됩니다.
이런식이 되겠네요

public Form1()

{

    InitializeComponent();

 

    Form2 frm = new Form2();

    frm.FormClosing += new FormClosingEventHandler(frm_FormClosing);

    frm.ShowDialog();

}

 

void frm_FormClosing(object sender, FormClosingEventArgs e)

{

    // 실행할 메소드 호출

    Temp();

}

 

void Temp()

{

    MessageBox.Show(" 닫혔음");

}


Posted by penguindori
Common C#/C# BEST TIP2009. 5. 19. 15:44

1. 해당 달의 첫날을 DateTime형 변수에 넣고. Date.AddMonths(1) 한후 Date.AddDay(-1) 하면 되요

2. msdn보니 방법이 있네여 System.DateTime.DaysInMonth(년도,월); 답변감사 드립니다.

3. 날짜 계산 하기
1)

TimeSpan timeSpan = Convert.ToDateTime(retDay) - Convert.ToDateTime(toDay);
=> 12.00:00:00
2)
DateTime d1 = DateTime.Today;  //오늘날자
DateTime d2 = DateTime.Today.AddDays(8);  //8일을 더한다
TimeSpan sp = d2.Subtract(d1); //두날자를 뺀다
label1.Text = sp.TotalDays.ToString(); //타입스팬을 날자로 변겨한다
3)
DateTime d1 = DateTime.Today;  //오늘날자
DateTime d2 = DateTime.Today.AddDays(8);  //8일을 더한다
TimeSpan sp = d2.Subtract(d1); //두날자를 뺀다

label1.Text = sp.TotalDays.ToString(); //타입스팬을 날자로 변겨한다
=> 이렇게 했을 때는 소수점까지 나올수 있습니다. 시간차이를 날짜수로 바꿔서 표현하기 때문입니다.

시간이하의 값을 무시할 경우에는
sp.Days.ToStirng() 처리하면 됩니다.
만약 2.11:20:30 라면
TotalDays를 사용할 경우 2.**** 식으로 표현되고. (double형)
Days를 쓰면 2가 되는 것이죠.(int형)

Posted by penguindori
Common C#/C# BEST TIP2009. 5. 15. 15:24
Assembly assembly = Assembly.GetExecutingAssembly();
Version ver = assembly.GetName().Version; <-버전 클래스

------ 꼽사리 ------ powerPoint
using System;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;

namespace ExtractImage
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: {0} powerpoint.ppt", System.Windows.Forms.Application.ExecutablePath);
                return;
            }

            string fileName = args[0];
            FileInfo info = new FileInfo(fileName);
            ExtractImage(info.FullName);
        }

        static void ExtractImage(string fileName)
        {
            ApplicationClass app = new ApplicationClass();
            Presentation ppt =
               app.Presentations.Open(fileName, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);

            Regex re = new Regex(@".ppt$", RegexOptions.IgnoreCase);
            string imgFile = re.Replace(fileName, "");

            for (int i = 0; i < ppt.Slides.Count; ++i)
            {
                ppt.Slides[i + 1].Export(imgFile + i + ".png", "PNG", 960, 720);
            }

            ppt.Close();
            app.Quit();
        }
    }
}
Posted by penguindori