반응형
1
2
3
4
5
6
7
8
|
using (System.Diagnostics.Process process = new System.Diagnostics.Process())
{
string printerName = "Printer Name";
process.StartInfo.FileName = "rundll32";
process.StartInfo.Arguments = @"C:\WINDOWS\system32\shimgvw.dll,ImageView_PrintTo """ + ImagePath + @""" " + @"""" + printerName + @"""";
process.StartInfo.UseShellExecute = true;
process.Start();
}
|
cs |
프린터이름이랑 이미지파일 위치를 설정해줘야한다.
rundll32 shimgvw.dll ImageView_PrintTo /pt C:\test.png "Printer Name"
배치 파일로 만든다면 이런 느낌이다.
반응형
'C#' 카테고리의 다른 글
C# winform 구성 시스템을 초기화하지 못했습니다. 에러 해결방법 (0) | 2023.01.18 |
---|---|
C# 폴더에서 특정 확장자만 가져와서 시간순으로 정렬 후 10개만 가져오는 코드 (Linq) (0) | 2022.07.26 |
c# 멀티쓰레드 SpinLock 구현 (0) | 2022.04.17 |
댓글