publicboolOpenWindowsFirewall {get;set; }
PublicPropertyOpenWindowsFirewallAsBoolean
true to open the Windows firewall automatically; false if the firewall is not to be opened automatically.
The default value is true. If the firewall is opened automatically the server closes it when the server stops running.
If the method fails, an error is raised. For more information, refer to theError Codes.
usingLeadtools;
usingLeadtools.MediaStreaming;
publicServer _server =null;
publicbool_result =false;
publicvoidPrintNetworkPropertiesExample()
{
try
{
stringstrNetworkProperties ="";
// create an instance of the server object
_server =newLeadtools.MediaStreaming.Server();
// retrieve a copy of the Network Properties
NetworkProperties道具= _server。GetNetworkProperties();
// print the Network Properties to a string
strNetworkProperties +="--- Network Properties ---\n\n";
strNetworkProperties +=string.Format("IPAddress = {0}\n", props.IPAddress);
strNetworkProperties +=string.Format("ActualIPAddress = {0}\n", props.ActualIPAddress);
strNetworkProperties +=string.Format("Port = {0}\n", props.Port.ToString());
strNetworkProperties +=string.Format("RTPPort = {0}\n", props.RTPPort.ToString());
if(props.OpenWindowsFirewall)
strNetworkProperties +="OpenWindowsFirewall = true\n";
else
strNetworkProperties +="OpenWindowsFirewall = false\n";
switch(props.Authentication)
{
caseAuthentication.Basic:
strNetworkProperties +="Authentication = Basic\n";
break;
caseAuthentication.Digest:
strNetworkProperties +="Authentication = Digest\n";
break;
default:
strNetworkProperties +="Authentication = None\n";
break;
}
strNetworkProperties +=string.Format("UserName = \"{0}\"\n", props.UserName);
strNetworkProperties +=string.Format("Password = \"{0}\"\n", props.Password);
strNetworkProperties +=string.Format("Realm = \"{0}\"\n", props.Realm);
strNetworkProperties +=string.Format("IdleTimeOut = {0}\n", props.IdleTimeOut.ToString());
strNetworkProperties +=string.Format("RTCPTimeOut = {0}\n", props.RTCPTimeOut.ToString());
strNetworkProperties +=string.Format("ServerName = \"{0}\"\n", props.ServerName);
if(props.RTSPEnable)
strNetworkProperties +="RTSPEnable = true\n";
else
strNetworkProperties +="RTSPEnable = false\n";
if(props.RTMPEnable)
strNetworkProperties +="RTMPEnable = true\n";
else
strNetworkProperties +="RTMPEnable = false\n";
if(props.HDSEnable)
strNetworkProperties +=“HDSEnable = true \ n”;
else
strNetworkProperties +="HDSEnable = false\n";
if(props.SSFEnable)
strNetworkProperties +="SSFEnable = true\n";
else
strNetworkProperties +="SSFEnable = false\n";
if(props.DASHEnable)
strNetworkProperties +="DASHEnable = true\n";
else
strNetworkProperties +="DASHEnable = false\n";
strNetworkProperties +=string.Format("MediaFolder = \"{0}\"\n", props.MediaFolder);
strNetworkProperties +=string.Format("ResolvedMediaFolder = \"{0}\"\n", props.ResolvedMediaFolder);
strNetworkProperties +=string.Format("SSLPort = \"{0}\"\n", props.SSLPort.ToString());
byte[] hash = (byte[])props.SSLCertificateHash;
stringstrhash ="";
if(hash.Length == 0)
strhash ="
" ;for(intn = 0; n < hash.Length; n++)
{
strhash += hash[n].ToString();
}
strNetworkProperties +=string.Format("SSLCertificateHash = \"{0}\"\n", strhash);
strNetworkProperties +=string.Format("SSLCertificateStore = \"{0}\"\n", props.SSLCertificateStore);
// display a message contains the Network Properties string
MessageBox.Show(strNetworkProperties,"LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information);
_result =true;
}
catch(Exception)
{
_result =false;
}
}
ImportsLeadtools
ImportsLeadtools.MediaStreaming
Public_serverAsServer =Nothing
Public_resultAsBoolean=False
PublicSubPrintNetworkPropertiesExample()
Try
DimstrNetworkPropertiesAsString=""
' create an instance of the server object
_server =NewLeadtools.MediaStreaming.Server()
' retrieve a copy of the Network Properties
DimpropsAsNetworkProperties = _server.GetNetworkProperties()
' print the Network Properties to a string
strNetworkProperties &="--- Network Properties ---"& Constants.vbLf + Constants.vbLf
strNetworkProperties &=String.Format("IPAddress = {0}"& Constants.vbLf, props.IPAddress)
strNetworkProperties &=String.Format("ActualIPAddress = {0}"& Constants.vbLf, props.ActualIPAddress)
strNetworkProperties &=String.Format("Port = {0}"& Constants.vbLf, props.Port.ToString())
strNetworkProperties &=String.Format("RTPPort = {0}"& Constants.vbLf, props.RTPPort.ToString())
Ifprops.OpenWindowsFirewallThen
strNetworkProperties &="OpenWindowsFirewall = true"& Constants.vbLf
Else
strNetworkProperties &="OpenWindowsFirewall = false"& Constants.vbLf
EndIf
SelectCaseprops.Authentication
CaseAuthentication.Basic
strNetworkProperties &="Authentication = Basic"& Constants.vbLf
CaseAuthentication.Digest
strNetworkProperties &="Authentication = Digest"& Constants.vbLf
CaseElse
strNetworkProperties &="Authentication = None"& Constants.vbLf
EndSelect
strNetworkProperties &=String.Format("UserName = ""{0}"""& Constants.vbLf, props.UserName)
strNetworkProperties &=String.Format("Password = ""{0}"""& Constants.vbLf, props.Password)
strNetworkProperties &=String.Format("Realm = ""{0}"""& Constants.vbLf, props.Realm)
strNetworkProperties &=String.Format("IdleTimeOut = {0}"& Constants.vbLf, props.IdleTimeOut.ToString())
strNetworkProperties &=String.Format("RTCPTimeOut = {0}"& Constants.vbLf, props.RTCPTimeOut.ToString())
strNetworkProperties &=String.Format("ServerName = ""{0}"""& Constants.vbLf, props.ServerName)
Ifprops.RTSPEnableThen
strNetworkProperties &="RTSPEnable = true"& Constants.vbLf
Else
strNetworkProperties &="RTSPEnable = false"& Constants.vbLf
EndIf
Ifprops.RTMPEnableThen
strNetworkProperties &="RTMPEnable = true"& Constants.vbLf
Else
strNetworkProperties &="RTMPEnable = false"& Constants.vbLf
EndIf
Ifprops.HDSEnableThen
strNetworkProperties &="HDSEnable = true"& Constants.vbLf
Else
strNetworkProperties &="HDSEnable = false"& Constants.vbLf
EndIf
Ifprops.SSFEnableThen
strNetworkProperties &="SSFEnable = true"& Constants.vbLf
Else
strNetworkProperties &="SSFEnable = false"& Constants.vbLf
EndIf
Ifprops.DASHEnableThen
strNetworkProperties &="DASHEnable = true"& Constants.vbLf
Else
strNetworkProperties &="DASHEnable = false"& Constants.vbLf
EndIf
strNetworkProperties &=String.Format("MediaFolder = ""{0}"""& Constants.vbLf, props.MediaFolder)
strNetworkProperties &=String.Format("ResolvedMediaFolder = ""{0}"""& Constants.vbLf, props.ResolvedMediaFolder)
strNetworkProperties +=String.Format("SSLPort = ""{0}"""& Constants.vbLf, props.SSLPort.ToString())
DimhashAsByte() =CType(props.SSLCertificateHash,Byte())
DimstrhashAsString=""
Ifhash.Length = 0Then
strhash ="
" EndIf
DimnAsInteger= 0
DoWhilen < hash.Length
strhash &= hash(n).ToString()
n += 1
Loop
strNetworkProperties +=String.Format("SSLCertificateHash = ""{0}"""& Constants.vbLf, strhash)
strNetworkProperties +=String.Format("SSLCertificateStore = ""{0}"""& Constants.vbLf, props.SSLCertificateStore)
' display a message contains the Network Properties string
MessageBox.Show(strNetworkProperties,"LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information)
_result =真正的
Catche1AsException
_result =False
EndTry
EndSub
Help Collections
Raster.NET|C API|C++ Class Library|HTML5 JavaScript
Document.NET|C API|C++ Class Library|HTML5 JavaScript
Medical.NET|C API|C++ Class Library|HTML5 JavaScript
Medical Web Viewer.NET
188宝金博怎么下载
Media Foundation.NET|C API|Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.