Windows Form Application의 path를 구하는 방법은 간단하다.
Application.ExecutablePath 를 사용하면 된다.
아래는 사용 예제이다.
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.textBox1.Text = Application.ExecutablePath;
}
}
}
Application.ExecutablePath 를 사용하면 된다.
아래는 사용 예제이다.
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.textBox1.Text = Application.ExecutablePath;
}
}
}
'Code > C#' 카테고리의 다른 글
| XML Serialization 사용법과 예제 (0) | 2007.12.15 |
|---|---|
| Path 클래스를 사용해서 원하는 파일의 위치를 지정하는 방법 (0) | 2007.12.15 |
| 실행중인 application의 path를 구하는 방법 (0) | 2007.12.15 |
| BinaryFormatter.Serialize 사용법 (0) | 2007.12.12 |
| Generic Method 를 이용한 Serialization (0) | 2007.12.10 |