Re: How to Checking a URL :Valid or Invalid

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I don't see what can you do at the client short of comparing
against a list of known good URLs, considering the fact both
URL's are properly formed, e.g. syntactically correct...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"Rasheed" <sk.rasheedfarhan@xxxxxxxxx> wrote in message
news:1185812419.299323.21640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,
Could any body help me. Regarding how to check a URL is
Valid or
Invalid.
I am using Four functions to check the same.
1) hConnect = WinHttpConnect( hSession, "www.google.co.in",
INTERNET_DEFAULT_HTTPS_PORT, 0);
2) hRequest = WinHttpOpenRequest( hConnect,
"{GET}",
pUrl, /// "/sea123rch?
hl=en&q=flow123ers&meta="
NULL,
WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
WINHTTP_FLAG_BYPASS_PROXY_CACHE );
3) bResults = WinHttpSendRequest( hRequest,
WINHTTP_NO_ADDITIONAL_HEADERS, 0,
WINHTTP_NO_REQUEST_DATA, 0,
0, 0 );
4) bResults = WinHttpReceiveResponse( hRequest, NULL );

Here is my observation when I have given the wrong URL in
WinHttpOpenRequest(..pUrl..), it has to throw the
ERROR_WINHTTP_INVALID_URL or at least WinHttpSendRequest() has to
thorw the Exception but I haven't getting this.


Would I have to set any flag to check URL is valid or not please if
any Sample code would be good.


Can any body please help me out to sort out this problem.


Here is the example for Valid and Invalid URL:


Valid URL:
http://www.google.co.in/search?hl=en&q=flowers&meta=


Invalid URL:
http://www.google.co.in/sea123rch?hl=en&q=flow123ers&meta=


Regards,
Rs.



.



Relevant Pages

  • How to Checking a URL :Valid or Invalid
    ... Could any body help me. ... hRequest = WinHttpOpenRequest(hConnect, ... ERROR_WINHTTP_INVALID_URL or at least WinHttpSendRequest() has to ...
    (microsoft.public.platformsdk.security)
  • How to Checking a URL :Valid or Invalid
    ... Could any body help me. ... hRequest = WinHttpOpenRequest(hConnect, ... ERROR_WINHTTP_INVALID_URL or at least WinHttpSendRequest() has to ...
    (microsoft.public.win32.programmer.networks)
  • Dont break my Heart!!!!!
    ... hConnect = WinHttpConnect(hSession, L"www.myspace.com", ... hRequest = WinHttpOpenRequest(hConnect, L"POST", NULL, ... bResults = WinHttpAddRequestHeaders(hRequest, ... WinHttpCloseHandle; ...
    (microsoft.public.win32.programmer.networks)
  • Re: Dont break my Heart!!!!!
    ... hConnect = WinHttpConnect(hSession, L"www.myspace.com", ... hRequest = WinHttpOpenRequest(hConnect, L"POST", NULL, ... bResults = WinHttpAddRequestHeaders(hRequest, ... WinHttpCloseHandle; ...
    (microsoft.public.win32.programmer.networks)
  • Re: Dont break my Heart!!!!!
    ... hConnect = WinHttpConnect(hSession, L"www.myspace.com", ... hRequest = WinHttpOpenRequest(hConnect, L"POST", NULL, ... bResults = WinHttpAddRequestHeaders(hRequest, ... WinHttpCloseHandle; ...
    (microsoft.public.win32.programmer.networks)