■ FindMimeFromData API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
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 31 32 |
using System.Runtime.InteropServices; #region 데이터에서 MIME 찾기 - FindMimeFromData(bindContext, url, bufferByteArray, size, mimeProposed, mimeFlag, mime, reserverd) /// <summary> /// 데이터에서 MIME 찾기 /// </summary> /// <param name="bindContext">바인딩 컨텍스트</param> /// <param name="url">URL</param> /// <param name="bufferByteArray">버퍼 바이트 배열</param> /// <param name="size">크기</param> /// <param name="mimeProposed">제안 MIME</param> /// <param name="mimeFlag">MIME 플래그</param> /// <param name="mime">MIME</param> /// <param name="reserverd">예약</param> /// <returns>처리 결과</returns> [DllImport("urlmon", CharSet = CharSet.Auto)] private extern static uint FindMimeFromData ( uint bindContext, [MarshalAs(UnmanagedType.LPStr)] string url, [MarshalAs(UnmanagedType.LPArray)] byte[] bufferByteArray, uint size, [MarshalAs(UnmanagedType.LPStr)] string mimeProposed, uint mimeFlag, out uint mime, uint reserverd ); #endregion |