2011-12-23 3 views
1

http://pub:[email protected]/axis-cgi/jpg/image.cgi?resolution=4CIF

, 그것은 크롬에서 다른 표시, 파이어 폭스와 IE 9

1) 크롬은 나에게 줄 수 있습니다 그림 및 디스플레이.

2) 파이어 폭스가 먼저 나에게 확인 대화 상자를 표시, 확인을 클릭하면, 그것은 나에게 바로 사진을 제공 할 수 있습니다.

3) IE 9, 그것은 나를 보여줍니다 크롬 브라우저처럼 카메라 서버에 액세스 할 수있는 방법이 있나요 대화 상자

'윈도우 .... 찾을 수 없습니다'.

카메라 서버를 요청하기 위해 asp.net을 사용하고 싶습니다. http://myipaddress/axis-cgi/jpg/image.cgi?resolution=4CIF을 사용하는 경우 사용자 이름과 비밀번호를 입력하면 Windows Security 대화 상자가 나타납니다.

C# 코드에서 사용자 이름과 암호를 보내려하고 'Windows 보안'대화 상자를보고 싶지 않지만 카메라 서버 사용자 설정에서 Enable anonymous viewer login을 설정하고 싶지 않습니다.

해결 방법이 있습니까?

+0

을 보낼 웹 클라이언트의 Credetials 속성을 사용할 수 있습니다 .NET, URL을 사용 = "http://192.168.101.110/axis-cgi/com/ptz.cgi?query=position"방법 개인 문자열 getResult를의 (문자열 URL) { 웹 클라이언트 클라이언트 = 새로운 웹 클라이언트(); string result = System.Text.Encoding.ASCII.GetString (client.DownloadData (url)); 반품 결과; }, client.DownloadData (url)을 실행하면 '원격 서버에서 오류 (401)가 반환되었습니다.'라는 메시지가 표시됩니다. – shotoyos

답변

0
WebClient client = new WebClient(); 
    client.Credentials = new NetworkCredential(username, password); 
    byte[] result = client.DownloadData(url); 

C# .NET에서, 우리는 C#에서 사용자 이름과 암호

0

당신은 사용자 이름과 암호를 취할 필요와 목적에 그들을 포함

<html> 
<head> 
<title>H.264 Live View</title> 
</head> 
<body> 

<div align="center"><h2>H.264 Live View</h2> 
<form name="test"> 
    <input id="ip" type="input" size="10" value="0.0.0.0"> 
    <input type="button" name="Play" value="Play" onClick="OnPlay(); return false;"> 
</form> 
<object id="Player" height="480" width="640" border="1" 
    classid="CLSID:745395C8-D0E1-4227-8586-624CA9A10A8D"> 
    <param name="AutoStart" value="1"> 
    <param name="UIMode" value="none"> 
    <param name="MediaType" value="h264"> 
    <param name="NetworkTimeout" value="5000"><!-- use this param if you want to change the network timeout --> 
    <param name="MediaUsername" value=""><!-- this param only necessary if restricted access is enabled --> 
    <param name="MediaPassword" value=""><!-- this param only necessary if restricted access is enabled --> 
    <param name="MediaURL" value="axrtpu://myServer/axis-media/media.amp?videocodec=h264"><!-- your media url goes here --> 
</object> 
</div> 
<script language="JavaScript"> 
<!--  
    document.Player.EnableContextMenu = true; 
    document.Player.StretchToFit = true; 
    document.Player.MaintainAspectRatio = true; 
//--> 
</script> 

<script language="JavaScript"> 
<!-- 
function OnPlay() 
{ 
    try 
    { 
    var server = document.getElementById('ip').value; 
    // return values from AMC methods are handled as exceptions in JavaScript 
    document.Player.Stop(); 
    document.Player.MediaURL = "axrtsphttp://" + server + "/axis-media/media.amp?videocodec=h264"; 
    document.Player.Play(); 
    } 
    catch(e){} 
} 
//--> 
</script> 

<script language="JavaScript" for="Player" event="OnError(theError, theMsg)"> 
<!-- 
    alert(theError + ' ' + theMsg); 
//--> 
</script> 

</body> 
</html> 
+0

감사합니다.하지만 embed 객체를 사용하고 싶지 않은 경우 액세스 할 수 있습니까? Axis Communications의 일부 API가이 업무를 수행 할 수 있습니까? Axis Communications의 VAPIX® 문서에서 찾을 수 없습니다. – shotoyos