2014년 7월 8일 화요일

[c#] 엑셀 파일 읽기

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

using Excel = Microsoft.Office.Interop.Excel;

namespace ReadExcel
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Excel.Application xlApp = new Excel.Application();
            Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"C:\\C.xlsx");
            Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1];
            Excel.Range xlRange = xlWorksheet.UsedRange;

            int rowCount = xlRange.Rows.Count;
            int colCount = xlRange.Columns.Count;

            for (int i = 1; i <= rowCount; i++)
            {
                for (int j = 1; j <= colCount; j++)
                {
                    MessageBox.Show(xlRange.Cells[i, j].Value2.ToString());
                }
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
        }

    }
}

클릭하면 div를 보여주는 jquery 소스

<button>Toggle</button>
<div id="select" style="display: none">
<p>Such interesting text, eh?</p>
</div>
<div>this is second para</div>
</body>

<script>
$( "button" ).click(function() {
$('#select').toggle( "slow" );
});
</script>

2014년 6월 28일 토요일

[c#]1분 간격으로 이벤트 실행

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

namespace sendgmail
{
    public partial class Form1 : Form
    {
        static System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
       
        public Form1()
        {
            InitializeComponent();

            timer.Tick += new EventHandler(timer_Tick); // Everytime timer ticks, timer_Tick will be called
            timer.Interval = 60 * 1000;
            timer.Enabled = true;                       // Enable the timer
            timer.Start();    

  
        }

        // 쓰레드풀의 작업쓰레드가 지정된 시간 간격으로
        // 아래 이벤트 핸들러 실행
        private void timer_Tick(object sender, EventArgs e)
        {
            // MessageBox.Show("timer success");

        }

    }
}

2014년 6월 26일 목요일

윈도우환경에서 autoconf 사용

mingw32를 다운받고 installer에서 msys를 선택한 후 설치한다.

명령프롬프트에서 bash 입력

./configure 명령을 사용할 수 있다.

2014년 6월 25일 수요일

서브버전 사용법

서브버전 클라이언트를 설치
http://sourceforge.net/projects/win32svn/


명령프롬프트에서

svn checkout [주소]