실행파일 위치와 경로

1. System.Reflection.Assembly.GetExecutingAssembly.Location
   현재 실행중인 파일의 경로명과 파일명 모두 가져온다. 경로까지만 가져오려면 \과 그 다음을 제거해야 함

2. System.AppDomain.CurrentDomain.BaseDirectory()
   경로명만 가져온다.

3. Application.StartupPath
   응용프로그램을 시작한 실행 파일의 경로(실행파일 이름 제외)를 가져온다.

4. My.Application.Info.DirectoryPath()
   응용프로그램이 저장된 디렉토리를 가져온다.

5. My.Computer.FileSystem.CurrentDirectory
현재 디렉터리를 가져오거나 설정합니다.

 

 

Environment.GetEnvironmentVariable("userprofile")

 

 

MyComputer
LocalizedResources
CommonOemLinks
ProgramFiles            C:\Program Files (x86) 
ProgramFilesX86         C:\Program Files (x86) 
CommonProgramFiles      C:\Program Files (x86)\Common Files 
CommonProgramFilesX86   C:\Program Files (x86)\Common Files 
CommonApplicationData   C:\ProgramData 
CommonStartMenu         C:\ProgramData\Microsoft\Windows\Start Menu 
CommonPrograms          C:\ProgramData\Microsoft\Windows\Start Menu\Programs 
CommonAdminTools        C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools 
CommonStartup           C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup 
CommonTemplates         C:\ProgramData\Microsoft\Windows\Templates 
UserProfile             C:\Users\fisch 
LocalApplicationData    C:\Users\fisch\AppData\Local 
CDBurning               C:\Users\fisch\AppData\Local\Microsoft\Windows\Burn\Burn 
History                 C:\Users\fisch\AppData\Local\Microsoft\Windows\History 
InternetCache           C:\Users\fisch\AppData\Local\Microsoft\Windows\INetCache 
Cookies                 C:\Users\fisch\AppData\Local\Microsoft\Windows\INetCookies 
ApplicationData         C:\Users\fisch\AppData\Roaming 
NetworkShortcuts        C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Network Shortcuts 
PrinterShortcuts        C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Printer Shortcuts 
Recent                  C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Recent 
SendTo                  C:\Users\fisch\AppData\Roaming\Microsoft\Windows\SendTo 
StartMenu               C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Start Menu 
Programs                C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Start Menu\Programs 
AdminTools              C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Administrative Tools 
Startup                 C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 
Templates               C:\Users\fisch\AppData\Roaming\Microsoft\Windows\Templates 
Desktop                 C:\Users\fisch\Desktop 
DesktopDirectory        C:\Users\fisch\Desktop 
Favorites               C:\Users\fisch\Favorites 
MyMusic                 C:\Users\fisch\Music 
MyDocuments             C:\Users\fisch\OneDrive\Documents 
MyDocuments             C:\Users\fisch\OneDrive\Documents 
MyPictures              C:\Users\fisch\OneDrive\Pictures 
MyVideos                C:\Users\fisch\Videos 
CommonDesktopDirectory  C:\Users\Public\Desktop 
CommonDocuments         C:\Users\Public\Documents 
CommonMusic             C:\Users\Public\Music 
CommonPictures          C:\Users\Public\Pictures 
CommonVideos            C:\Users\Public\Videos 
Windows                 C:\Windows 
Fonts                   C:\Windows\Fonts 
Resources               C:\Windows\resources 
System                  C:\Windows\system32 
SystemX86               C:\Windows\SysWoW64 

이 게시물을

댓글'4'

ProgramFiles 경로 : My.Computer.FileSystem.SpecialDirectories.ProgramFiles


내문서 경로 : My.Computer.FileSystem.SpecialDirectories.MyDocuments

이 댓글을

Application.ExecutablePath
or

System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
or

System.Reflection.Assembly.GetExecutingAssembly().Location

이 댓글을

바탕화면

 

My.Computer.FileSystem.SpecialDirectories.Desktop

이 댓글을

My.Computer.FileSystem.CurrentDirectory = Application.StartupPath

이 댓글을

공유하기

SEARCH

MENU NAVIGATION