Share via


PathIsURLA 함수(shlwapi.h)

지정된 문자열을 테스트하여 유효한 URL 형식을 준수하는지 확인합니다.

구문

BOOL PathIsURLA(
  [in] LPCSTR pszPath
);

매개 변수

[in] pszPath

형식: LPCTSTR

유효성을 검사할 URL 경로가 포함된 최대 길이 MAX_PATH null로 끝나는 문자열에 대한 포인터입니다.

반환 값

형식: BOOL

pszPath에 유효한 URL 형식이 있으면 TRUE를 반환하고, 그렇지 않으면 FALSE를 반환합니다.

설명

이 함수는 경로가 유효한 URL 형식을 갖는 경우에만 기존 사이트를 가리키는지 확인하지 않습니다.

예제

#include <windows.h>
#include <iostream.h>
#include "Shlwapi.h"

void main( void )
{
// String path name 1.
char buffer_1[ ] = "http://www.microsoft.com/software/index.html";
char *lpStr1;
lpStr1 = buffer_1;

// String path name 2.
char buffer_2[ ] = "http://www.microsoft.com";
char *lpStr2;
lpStr2 = buffer_2;

// String path name 3.
char buffer_3[ ] = "microsoft.com";
char *lpStr3;
lpStr3 = buffer_3;

// Variable to get the return 
// from "PathIsURL".
int retval;

// Test path name 1.
retval = PathIsURL(lpStr1);
cout << "The contents of String 1: " << lpStr1
     << "\nThe return value from the function is " << retval << " = TRUE" << endl;

// Test path name 2.
retval = PathIsURL(lpStr2);
cout << "The contents of String 2: " << lpStr2
     << "\nThe return value from the function is " << retval << " = TRUE" << endl;

// Test path name 3.
retval = PathIsURL(lpStr3);
cout << "The contents of String 3: " << lpStr3
     << "\nThe return value from the function is " << retval << " = FALSE"<< endl;
}

OUTPUT:
=============
The contents of String 1: http://www.microsoft.com/software/index.html
The return value from the function is 1 = TRUE
The contents of String 2: http://www.microsoft.com
The return value from the function is 1 = TRUE
The contents of String 3: microsoft.com
The return value from the function is 0 = FALSE

참고

shlwapi.h 헤더는 PATHIsURL을 유니코드 전처리기 상수의 정의에 따라 이 함수의 ANSI 또는 유니코드 버전을 자동으로 선택하는 별칭으로 정의합니다. 인코딩 중립 별칭을 인코딩 중립이 아닌 코드와 혼합하면 컴파일 또는 런타임 오류가 발생하는 불일치가 발생할 수 있습니다. 자세한 내용은 함수 프로토타입에 대한 규칙을 참조하세요.

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows 2000 Professional, Windows XP [데스크톱 앱만 해당]
지원되는 최소 서버 Windows 2000 Server[데스크톱 앱만]
대상 플랫폼 Windows
헤더 shlwapi.h
라이브러리 Shlwapi.lib
DLL Shlwapi.dll(버전 4.71 이상)