일반
C# 폴더열기
알 수 없는 사용자
2022. 3. 4. 14:55
SMALL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FolderOpen
{
class Program
{
static void Main(string[] args)
{
//사용자가 열고자 하는 폴더 경로 지정
string localFolderPath = @"D:\";
//D드라이브 폴더 실행
System.Diagnostics.Process.Start(localFolderPath);
}
}
}
//내 폴더 위치 불러오기
System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
//폴더 있는지 확인하고 생성하기
if(!Directory.Exists("path"))
{
System.IO.Directory.CreateDirectory("path");
}
//폴더 열기
System.Diagnostics.Process.Start("FolderPath")
참고링크
LIST