바로 전 글에서 파일에서 BOM 표시를 제거 하는 예제를 만들어 보았습니다.
BOM 문자 제거하기
https://www.rgagnon.com/javadetails/java-handle-utf8-file-with-bom.html Real's How-to Real's HowTo : Useful code snippets for Java, JS, PB and more www.rgagnon.com XML 파일을 파싱하려다 보니 너무 많..
tobee.tistory.com
그럼 이 BOM이 파일에서 제거 되었는 지 여부를 확인 해야하는 데요.
파일의 첫 머리 몇 바이트를 점검 해 보면 되는 바이기 때문에 간단히 프로그램을 하나 만들어 보면 어떨까 합니다.
다음 사이트에서 C# 에서 간단한 바이너리 뷰어 컨트롤을 가지고 있다는 것을 알게 되었다는 거죠
http://codeguru.com/dotnet/viewing-binary-data-using-byteviewer/
Viewing Binary Data Using ByteViewer | CodeGuru
Did you know that the .NET framework has a built-in control/class for displaying the hexadecimal byte dump output of binary data? It's one of those rare
www.codeguru.com
ByteViewer Class (System.ComponentModel.Design)
Displays byte arrays in hexadecimal, ANSI, and Unicode formats.
docs.microsoft.com
예전에 만들어 본 이미지 축소 툴 밑에다가 하나 붙혀 보았습니다.
https://blog.naver.com/tommybee/222521341236
[C#] 이미지 축소 툴
재미로... 그 외 이유도 있지만, 이미지 축소 툴을 한 번 만들어 보았습니다. UI 구성은 다음과 같이 간...
blog.naver.com
소스는 별 내용 없이 다음과 같이 선언/정의하고
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
private ByteViewer _myByteViewer;
public Form1()
{
InitializeComponent();
_myByteViewer = new System.ComponentModel.Design.ByteViewer
{ Dock = DockStyle.Fill };
this.panel1.Controls.Add(_myByteViewer);
}
파일 다이얼로그에 붙혀 주면 됩니다.
private void button3_Click(object sender, EventArgs e)
{
openFileDialog1.InitialDirectory = @"C:\";
//If RestoreDirectory property set to true
//that means the open file dialogg box restores the current directory before closing.
openFileDialog1.RestoreDirectory = true;
openFileDialog1.Title = "입력 파일 선택";
openFileDialog1.FileName = "source text file to choose";
openFileDialog1.Filter = "txt Files|*.txt;*.text;...";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
_myByteViewer.SetFile(openFileDialog1.FileName);
}
}
다음은 만들어진 GUI 입니다. 밑에 패널만 하나랑 그 밑에 버튼하나를 급하게 붙혔습니다.

다음은 간단히 만들어진 바이너리 표시기 영상입니다.
'프로그래밍' 카테고리의 다른 글
자바에서 enum 사용 (0) | 2022.04.10 |
---|---|
자바, C++ enum (0) | 2022.04.10 |
[자바]파일에서 BOM 문자 제거하기 (0) | 2022.04.10 |
Win32 어셈블리 프로그래밍 - 4. 텍스트 그리기 (0) | 2022.04.04 |
Win32 어셈블리 프로그래밍 - 3. 간단한 윈도우 (0) | 2022.04.04 |