■ UrlCreateFromPath API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
using System; using System.Runtime.InteropServices; #region 경로에서 URL 생성하기 - UrlCreateFromPath(path, urlStringBuilder, urlLength, reserved) /// <summary> /// 경로에서 URL 생성하기 /// </summary> /// <param name="path">경로</param> /// <param name="urlStringBuilder">URL 문자열 빌더</param> /// <param name="urlLength">URL 길이</param> /// <param name="reserved">예약</param> /// <returns>처리 결과</returns> [DllImport("shlwapi", CharSet=CharSet.Auto, SetLastError=true)] private static extern int UrlCreateFromPath(string path, StringBuilder urlStringBuilder, ref int urlLength, int reserved); #endregion |