using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace IPconfig
{
public partial class Form1 : Form
{
[DllImport("msvcrt.dll")]
public static extern int system(string cmd);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
system("ipconfig>ipconfig.txt");
}
}
}
이런 식으로 윈폼에서 버튼을 클릭하면
cmd 명령어인 ipconfig>ipconfig.txt 를 실행하려고 햇는데
버튼을 누르면 콘솔 창이 뜨고 윈폼이 하나 더 실행되네요
저 명령어도 실행되지 않았구요
찾아봤는데 안 나와서 질문 올립니다 ㅜ
댓글 0