Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- flutter
- flutter tcpip client
- debugShowCheckedModeBanner
- Server
- peaks
- TCPIP
- dart:io
- Listview filtering
- ubuntu 19 한글 입력
- Properties.Settings.Default
- flutter tcpip server
- ListView.build
- flutter button
- debug banner
- AlertDialog
- c
- array
- showDialog
Archives
- Today
- Total
Louie De Janeiru
Dialog box open 본문
const String FILE_FILTER_IMAGE = "그림 파일 (*.jpg, *.gif, *.bmp, *.png, *.svd, *.webp) | *.jpg; *.gif; *.bmp; *.png; *.svd; *.webp; | 모든 파일 (*.*) | *.*";
const String FILE_FILTER_VIDEO = "비디오 파일 (*.mp4, *.avi, *.mpeg) | *.mp4; *.avi; *.mpeg; | 모든 파일 (*.*) | *.*";
public String ShowFileOpenDialog(String fileFilter)
{
try
{
//파일오픈창 생성 및 설정
OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "이미지 열기";
ofd.FileName = "image";
ofd.Filter = fileFilter;
ofd.InitialDirectory = Application.StartupPath; // 현재 실행파일 경로를 사용하도록 설정
//파일 오픈창 로드
DialogResult dr = ofd.ShowDialog();
//OK버튼 클릭시
if (dr == DialogResult.OK)
{
//File명과 확장자를 가지고 온다.
String fileName = ofd.SafeFileName;
//File경로와 File명을 모두 가지고 온다.
String fileFullName = ofd.FileName;
//File경로만 가지고 온다.
String filePath = fileFullName.Replace(fileName, "");
//File경로 + 파일명 리턴
return fileFullName;
}
//취소버튼 클릭시 또는 ESC키로 파일창을 종료 했을경우
else if (dr == DialogResult.Cancel)
{
return "";
}
return "";
}
catch (Exception e)
{
ERR(e.ToString());
return "";
}
}
String path = ShowFileOpenDialog(FILE_FILTER_IMAGE);
Cv.AbsDiffImage(path);
'C#' 카테고리의 다른 글
Display build date at Title Bar (0) | 2021.03.19 |
---|---|
Build date display at Form.Text (0) | 2020.12.29 |
Basic code for normal framework (0) | 2020.11.17 |
Screen Record (0) | 2020.09.16 |
Properties.Settings.Default (0) | 2019.09.24 |