Hi Tian,
Thank You for your response, upon doing more investigation i believe my
problem is due to a check that occurs after i try to open .jsp page and
before the final html code is generated, what seems to be happening is this
page first tries to check if a player is available and i believe when it's
not (using HttpWebResponse .GetResponse) it gives me an exception (500)
Is there a way for me to fake the request so that it looks like i have the
player installed ? All i am really interested in is getting the final html
generated by the server ?
Thank You
Below is the output obtained from web-sniffer.net after typing in the URL:
<!DOCTYPE·HTML· PUBLIC·"-//W3C//DTD·HTML·4.01·T ransitional//EN">[LF]
<html>[LF]
<head>[LF]
··<title>Player ·detection·in·B rowser...</title>[LF]
[LF]
<script·languag e="JavaScript ">[LF]
<!--[LF]
var·detectableW ithVB·=·false;[LF]
var·quicktimeVe rsion·=·1;[LF]
[LF]
[LF]
function·create ActiveXObject(i d)·{[LF]
··var·error;[LF]
··var·control·= ·null;[LF]
··try·{[LF]
····if·(window. ActiveXObject)· control·=·new·A ctiveXObject(id );[LF]
····else·if·(wi ndow.GeckoActiv eXObject)·contr ol·=·new·GeckoA ctiveXObject(id )
;[LF]
····}[LF]
··catch·(error) ·{·;·}[LF]
··return·contro l;[LF]
··}[LF]
//·-->[LF]
</script>[LF]
[LF]
[LF]
<script·languag e="VBscript">[LF]
[LF]
'do·a·one-time·test·for·a ·version·of·VBS cript·that·can· handle·this·cod e'[LF]
detectableWithV B·=·False[LF]
quicktimeVersio n·=·1[LF]
If·ScriptEngine MajorVersion·>= ·2·then[LF]
··detectableWit hVB·=·True[LF]
End·If[LF]
[LF]
'this·next·func tion·will·detec t·most·plugins'[LF]
Function·detect ActiveXControl( activeXControlN ame)[LF]
··on·error·resu me·next[LF]
··detectActiveX Control·=·False[LF]
··If·detectable WithVB·Then[LF]
·····detectActi veXControl·=·Is Object(CreateOb ject(activeXCon trolName))[LF]
··End·If[LF]
End·Function[LF]
[LF]
'and·the·follow ing·function·ha ndles·QuickTime '[LF]
Function·detect QuickTimeActive XControl()[LF]
··on·error·resu me·next[LF]
··detectQuickTi meActiveXContro l·=·False[LF]
··If·detectable WithVB·Then[LF]
····detectQuick TimeActiveXCont rol·=·False[LF]
····hasQuickTim eChecker·=·fals e[LF]
····Set·hasQuic kTimeChecker·=· CreateObject("Q uickTimeCheckOb ject.QuickTimeC h
eck.1")[LF]
····If·IsObject (hasQuickTimeCh ecker)·Then[LF]
······If·hasQui ckTimeChecker.I sQuickTimeAvail able(0)·Then·[LF]
········detectQ uickTimeActiveX Control·=·True[LF]
········quickti meVersion·=·CIn t(Hex(hasQuickT imeChecker.Quic kTimeVersion)·/·
1000000)[LF]
······End·If[LF]
····End·If[LF]
··End·If[LF]
End·Function[LF]
[LF]
</script>[LF]
[LF]
<script·type="t ext/javascript"·src ="/includes/cookie_ops.js"> </script>[LF]
<script·type="t ext/javascript"·src ="/includes/player_detect.j s"></script>[LF
]
[LF]
</head>[LF]
<body>[LF]
[LF]
[LF]
[LF]
<script>[LF]
var·lsMedia·=·n ew·Cookie(docum ent,·"lsMedia", ·0,·"/");[LF]
if·(canDetectPl ugins())·{[LF]
··if·(detectQui ckTime())·lsMed ia.QT·=·quickti meVersion;[LF]
··if·(detectRea l())·lsMedia.RP ·=·"Y";[LF]
··if·(detectWin dowsMedia())·{[LF]
····var·detecti onResults·=·det ectWMP();[LF]
····if·(detecti onResults.insta lled)·lsMedia.p t·=·detectionRe sults.typeOfPla y
er;[LF]
····lsMedia.WMP ·=·(detectionRe sults.installed )·?·detectionRe sults.versionIn f
o·:·"Y";[LF]
····}[LF]
··}[LF]
else·lsMedia.de tect·=·"none";[LF]
lsMedia.store() ;[LF]
</script>[LF]
[LF]
[LF]
[LF]
</body>[LF]
</html>[LF]
"Tian Min Huang" <ti******@onlin e.microsoft.com > wrote in message
news:RP******** ******@cpmsftng xa07.phx.gbl...
Hi,
Thanks for your post. WebClient class is used to send and receive data
from a resource identified by a URI. We cannot get .jsp result with WebClient,
instead we are able to use the HttpWebRequest and HttpWebResponse classes
to send HTTP requests and get the result like in IE. Please refer to the
following sample:
SAMPLE: Visual C# .NET Networking Classes HTTP Internet Client
http://support.microsoft.com/?id=303436
Please let me know the result.
Have a nice day!
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.