UserAgent财产

总结
检索客户端使用的浏览器类型。
语法
c#
VB
c++
[DispIdAttribute (18)]公共字符串UserAgent {得到;}
只读的财产UserAgent作为字符串
财产字符串^ UserAgent {字符串^ get ();}

属性值

一个字符串,表示客户端使用的浏览器类型。

讲话

如果方法失败,一个错误。有关更多信息,请参考错误代码

例子
c#
VB
使用Leadtools;使用Leadtools.MediaStreaming;枚举W3CLOG{= 0 x00000001日期,时间= 0 x00000002,c_ip = 0 x00000004,cs_username = 0 x00000008,s_sitename = 0 x00000010,s_computername = 0 x00000020,s_ip = 0 x00000040,s_port = 0 x00000080,cs_method = 0 x00000100,cs_uri_stem = 0 x00000200,cs_uri_query = 0 x00000400,sc_status = 0 x00000800,sc_win32_status = 0 x00001000,sc_bytes = 0 x00002000,cs_bytes = 0 x00004000,time_taken = 0 x00008000,cs_version = 0 x00010000,cs_host = 0 x00020000,cs_user_agent = 0 x00040000,cs_cookie = 0 x00080000,cs_referer = 0 x00100000,sc_substatus = 0 x00200000,};公共CW3CLogHandler: ILtmsLogHandler{boolm_enable;intm_fields;boolm_localtime;DateTime m_dtfile;字符串m_software;字符串m_folder;字符串m_prefix;StreamWriter m_sw;公共CW3CLogHandler (字符串前缀,字符串软件,bool启用,字符串文件夹,int字段,bool本地时间){m_prefix =前缀;m_software =软件;m_enable =启用;m_folder =文件夹;m_fields =字段;m_localtime =作用;}~ CW3CLogHandler (){}无效WriteString (字符串str){m_sw.Write (str);}DateTime取得时间(dTime){DateTime dt = DateTime.FromOADate (dTime);如果(m_localtime)返回dt.ToLocalTime ();返回dt;}字符串GetLogPath (时间戳){DateTime dt =取得时间(时间戳);字符串strFullPath;试一试{PathResolver解析器=PathResolver ();strFullPath = resolver.Resolve (m_folder);}{返回”“;}strFullPath + =“\ \”;strFullPath + = m_prefix;如果(m_localtime !){strFullPath + = dt.ToString (“y-MM-dd-HH-mm-ss”).Replace (“-”,”“)+“UTC.log”;}其他的{strFullPath + = dt.ToString (“y-MM-dd-HH-mm-ss”).Replace (“-”,”“)+. log”;}返回strFullPath;}公共无效LoadConfig服务器(服务器){bool使= m_enable;bool本地时间= m_localtime;字符串文件夹= m_folder;int字段= m_fields;bool肮脏的=;ApplicationProperties AppProps = server.GetApplicationProperties ();试一试{使= AppProps.GetBoolean (“LogEnable”);}{AppProps.AddBoolean (“LogEnable”使);肮脏的=真正的;}试一试{本地时间= AppProps.GetBoolean (“LogLocalTime”);}{AppProps.AddBoolean (“LogLocalTime”、作用);肮脏的=真正的;}试一试{文件夹= AppProps.GetString (“LogFolder”);}{AppProps.AddString (“LogFolder”、文件夹);肮脏的=真正的;}试一试{字段= AppProps.GetInteger (“LogFields”);}{AppProps.AddInteger (“LogFields”、字段);肮脏的=真正的;}如果(脏的)server.SetApplicationProperties (AppProps);/ /是否有变化我们需要关闭当前文件如果(!启用& & (字符串.Compare (m_folder文件夹,真正的)! = 0)| |字段! = m_fields | | m_localtime ! =作用){如果(m_sw ! =)m_sw.Close ();}m_folder =文件夹;m_localtime =作用;m_enable =启用;m_fields =字段;}boolCreateLog (时间戳){如果(m_sw ! =)m_sw.Close ();如果(m_enable !)返回;试一试{m_sw = File.CreateText (GetLogPath(时间戳));}{返回;}m_dtfile =取得时间(时间戳);字符串年代;s =“#软件:”+ m_software +“\ r \ n”;WriteString(年代);WriteString (“#版本:1.0 \ r \ n”);DateTime dt =取得时间(时间戳);s =" #日期:"+ dt.ToString (“yyyy-MM-dd HH: mm: ss”)+“\ r \ n”;WriteString(年代);s =“#字段:“;如果((m_fields & (int)W3CLOG.date) = = (intW3CLOG.date){s + =“日期”;}如果((m_fields & (int)W3CLOG.time) = = (intW3CLOG.time){s + =“时间”;}如果((m_fields & (int)W3CLOG.s_sitename) = = (intW3CLOG.s_sitename){s + =“s-sitename”;}如果((m_fields & (int)W3CLOG.s_computername) = = (intW3CLOG.s_computername){s + =“s-computername”;}如果((m_fields & (int)W3CLOG.s_ip) = = (intW3CLOG.s_ip){s + =“s-ip”;}如果((m_fields & (int)W3CLOG.cs_method) = = (intW3CLOG.cs_method){s + =“cs方法”;}如果((m_fields & (int)W3CLOG.cs_uri_stem) = = (intW3CLOG.cs_uri_stem){s + =“cs-uri-stem”;}如果((m_fields & (int)W3CLOG.cs_uri_query) = = (intW3CLOG.cs_uri_query){s + =“cs-uri-query”;}如果((m_fields & (int)W3CLOG.s_port) = = (intW3CLOG.s_port){s + =“s-port”;}如果((m_fields & (int)W3CLOG.cs_username) = = (intW3CLOG.cs_username){s + =“cs-username”;}如果((m_fields & (int)W3CLOG.c_ip) = = (intW3CLOG.c_ip){s + =“c-ip”;}如果((m_fields & (int)W3CLOG.cs_version) = = (intW3CLOG.cs_version){s + =“cs-version”;}如果((m_fields & (int)W3CLOG.cs_user_agent) = = (intW3CLOG.cs_user_agent){s + =“cs(用户代理)”;}如果((m_fields & (int)W3CLOG.cs_cookie) = = (intW3CLOG.cs_cookie){s + =“cs(饼干)”;}如果((m_fields & (int)W3CLOG.cs_referer) = = (intW3CLOG.cs_referer){s + =“cs(推荐人)”;}如果((m_fields & (int)W3CLOG.cs_host) = = (intW3CLOG.cs_host){s + =“cs-host”;}如果((m_fields & (int)W3CLOG.sc_status) = = (intW3CLOG.sc_status){s + =“sc-status”;}如果((m_fields & (int)W3CLOG.sc_substatus) = = (intW3CLOG.sc_substatus){s + =“sc-substatus”;}如果((m_fields & (int)W3CLOG.sc_win32_status) = = (intW3CLOG.sc_win32_status){s + =“sc-win32-status”;}如果((m_fields & (int)W3CLOG.sc_bytes) = = (intW3CLOG.sc_bytes){s + =“sc-bytes”;}如果((m_fields & (int)W3CLOG.cs_bytes) = = (intW3CLOG.cs_bytes){s + =“cs-bytes”;}如果((m_fields & (int)W3CLOG.time_taken) = = (intW3CLOG.time_taken){s + =“时间”;}s + =“\ r \ n”;WriteString(年代);m_sw.Flush ();返回真正的;}字符串逃避(字符串s){字符串t =”“;foreach(字符cs){如果(!字符.IsControl (c) & & !字符.IsWhiteSpace (c))t + = c;其他的t + =“+”;}返回t;}公共无效InitializeLog (时间戳){CreateLog(时间戳);}公共无效TerminateLog (){如果(m_sw ! =)m_sw.Close ();}公共无效LogInformation (ILtmsLogInformation信息){字符串s =”“;如果(m_enable !)返回;/ /检查是否我们需要将一个新文件{DateTime dt =取得时间(info.TimeStamp);如果(m_sw = =| | dt。一天! = m_dtfile。天| | dt。月! = m_dtfile。月| | dt。! = m_dtfile.Year){如果(! CreateLog (info.TimeStamp))返回;}}如果((m_fields & (int)W3CLOG.date) = = (intW3CLOG.date){DateTime dt =取得时间(info.TimeStamp);如果(s。长度> 0)s + =”“;s + = dt.ToString (“yyyy-MM-dd”);}如果((m_fields & (int)W3CLOG.time) = = (intW3CLOG.time){DateTime dt =取得时间(info.TimeStamp);如果(s。长度> 0)s + =”“;s + = dt.ToString (“HH: mm: ss”);}如果((m_fields & (int)W3CLOG.s_sitename) = = (intW3CLOG.s_sitename){字符串str = info.SiteName;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.s_computername) = = (intW3CLOG.s_computername){字符串str = info.ComputerName;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.s_ip) = = (intW3CLOG.s_ip){字符串str = info.ServerIP;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_method) = = (intW3CLOG.cs_method){字符串str = info.Method;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_uri_stem) = = (intW3CLOG.cs_uri_stem){字符串str = info.URIStem;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_uri_query) = = (intW3CLOG.cs_uri_query){字符串str = info.URIQuery;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.s_port) = = (intW3CLOG.s_port){intn = info.ServerPort;如果(s。长度> 0)s + =”“;s + = n.ToString ();}如果((m_fields & (int)W3CLOG.cs_username) = = (intW3CLOG.cs_username){字符串str = info.UserName;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.c_ip) = = (intW3CLOG.c_ip){字符串str = info.ClientIP;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_version) = = (intW3CLOG.cs_version){字符串str = info.ProtocolVersion;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_user_agent) = = (intW3CLOG.cs_user_agent){字符串str = info.UserAgent;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_cookie) = = (intW3CLOG.cs_cookie){字符串str = info.Cookie;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_referer) = = (intW3CLOG.cs_referer){字符串str = info.Referrer;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.cs_host) = = (intW3CLOG.cs_host){字符串str = info.Host;如果(s。长度> 0)s + =”“;如果(str.Length = = 0)s + =“-”;其他的s + =逃脱(str);}如果((m_fields & (int)W3CLOG.sc_status) = = (intW3CLOG.sc_status){intn = info.Status;如果(s。长度> 0)s + =”“;s + = n.ToString ();}如果((m_fields & (int)W3CLOG.sc_substatus) = = (intW3CLOG.sc_substatus){intn = info.ProtocolSubStatus;如果(s。长度> 0)s + =”“;s + = n.ToString ();}如果((m_fields & (int)W3CLOG.sc_win32_status) = = (intW3CLOG.sc_win32_status){intn = info.Win32Status;如果(s。长度> 0)s + =”“;s + = n.ToString ();}如果((m_fields & (int)W3CLOG.sc_bytes) = = (intW3CLOG.sc_bytes){intn = info.BytesSent;如果(s。长度> 0)s + =”“;如果(n < 0)s + =“-”;其他的s + = n.ToString ();}如果((m_fields & (int)W3CLOG.cs_bytes) = = (intW3CLOG.cs_bytes){intn = info.BytesReceived;如果(s。长度> 0)s + =”“;如果(n < 0)s + =“-”;其他的s + = n.ToString ();}如果((m_fields & (int)W3CLOG.time_taken) = = (intW3CLOG.time_taken){intn = info.TimeTaken;如果(s。长度> 0)s + =”“;如果(n < 0)s + =“-”;其他的s + = n.ToString ();}s + =“\ r \ n”;WriteString(年代);m_sw.Flush ();}}公共服务器_server =;公共bool_result =;公共无效W3CLogHandlerExample (){试一试{国家enumState;CW3CLogHandler _loghandler;/ /创建一个服务器对象的实例_server =Leadtools.MediaStreaming.Server ();/ /创建日志处理程序_loghandler =CW3CLogHandler (“ltmsServer_”,“LEADTOOLS流媒体服务器”,真正的,“% ltmsLogFolder %”0,);/ /设置日志处理程序_server。ILogHandler = _loghandler;{/ /用于演示,比较我们设置的接口ILtmsLogHandler ihandler =;ihandler = _server.ILogHandler;如果(ihandler ! = (ILtmsLogHandler) _loghandler){_result =;返回;}}/ /加载配置文件位于配置文件夹下的可执行文件的文件夹/ /或注释本节运行服务器的默认设置_server.ImportConfigFile (“% ltmsConfigFolder % \ \ LeadtoolsMediaStreamingServer.xml”);/ /启动服务器_server.Start ();/ /确认演示目的的运行状态enumState = _server.State;如果(enumState = = State.Started){/ /显示一条消息,服务器正在运行,等待好MessageBox.Show (“服务器已经开始。按OK停止。”,“LEADTOOLS流媒体的例子”,MessageBoxButtons。好的,MessageBoxIcon.Information);}/ /停止服务器_server.Stop ();/ /删除日志处理程序_server。ILogHandler =;_result =真正的;}(异常){_result =;}}
进口Leadtools进口Leadtools.MediaStreaming私人枚举W3CLOG(日期]= h1时间= h2c_ip = h4cs_username = h8s_sitename = h10s_computername = 3s_ip = &H40s_port = &H80cs_method = &H100cs_uri_stem = &H200cs_uri_query = &H400sc_status = &H800sc_win32_status = &H1000sc_bytes = &H2000cs_bytes = &H4000time_taken = &H8000cs_version = &H10000cs_host = &H20000cs_user_agent = &H40000cs_cookie = &H80000cs_referer = &H100000sc_substatus = &H200000结束枚举公共CW3CLogHandler:实现了ILtmsLogHandler私人m_enable作为布尔私人m_fields作为整数私人m_localtime作为布尔私人m_dtfile作为DateTime私人m_software作为字符串私人m_folder作为字符串私人m_prefix作为字符串私人m_sw作为StreamWriter公共(按值传递前缀作为字符串,按值传递软件作为字符串,按值传递启用作为布尔,按值传递文件夹作为字符串,按值传递字段作为整数,按值传递本地时间作为布尔)m_prefix =前缀m_software =软件m_enable =启用m_folder =文件夹m_fields =字段m_localtime =作用结束受保护的覆盖Finalize ()结束私人WriteString (按值传递str作为字符串)m_sw.Write (str)结束私人函数取得时间(按值传递dTime作为)作为DateTime昏暗的dt作为DateTime = DateTime.FromOADate (dTime)如果m_localtime然后返回dt.ToLocalTime ()结束如果返回dt结束函数私人函数GetLogPath (按值传递时间戳作为)作为字符串昏暗的dt作为DateTime =取得时间(时间戳)昏暗的strFullPath作为字符串试一试昏暗的解析器作为PathResolver =PathResolver ()strFullPath = resolver.Resolve (m_folder)返回”“结束试一试strFullPath & =“\”strFullPath & = m_prefix如果(m_localtime)然后strFullPath & = dt.ToString (“y-MM-dd-HH-mm-ss”).Replace (“-”,”“)&“UTC.log”其他的strFullPath & = dt.ToString (“y-MM-dd-HH-mm-ss”).Replace (“-”,”“)&. log”结束如果返回strFullPath结束函数公共LoadConfig (按值传递服务器作为服务器)昏暗的启用作为布尔= m_enable昏暗的本地时间作为布尔= m_localtime昏暗的文件夹作为字符串= m_folder昏暗的字段作为整数= m_fields昏暗的作为布尔=昏暗的AppProps作为ApplicationProperties = server.GetApplicationProperties ()试一试使= AppProps.GetBoolean (“LogEnable”)AppProps.AddBoolean (“LogEnable”启用)肮脏的=真正的结束试一试试一试本地时间= AppProps.GetBoolean (“LogLocalTime”)AppProps.AddBoolean (“LogLocalTime”、作用)肮脏的=真正的结束试一试试一试文件夹= AppProps.GetString (“LogFolder”)AppProps.AddString (“LogFolder”文件夹)肮脏的=真正的结束试一试试一试字段= AppProps.GetInteger (“LogFields”)AppProps.AddInteger (“LogFields”、字段)肮脏的=真正的结束试一试如果然后server.SetApplicationProperties (AppProps)结束如果如果任何改变了然后我们需要关闭当前文件如果(启用)需要说明(字符串.Compare (m_folder文件夹,真正的)< > 0)OrElse<字段> m_fieldsOrElsem_localtime < >本地时间然后如果m_sw没有什么然后m_sw.Close ()结束如果结束如果m_folder =文件夹m_localtime =作用m_enable =启用m_fields =字段结束私人函数CreateLog (按值传递时间戳作为)作为布尔如果m_sw没有什么然后m_sw.Close ()结束如果如果(m_enable)然后返回结束如果试一试m_sw = File.CreateText (GetLogPath(时间戳)返回结束试一试m_dtfile =取得时间(时间戳)昏暗的年代作为字符串s =“#软件:”& m_software & Constants.vbCrLfWriteString (s)WriteString (“#版本:1.0”& Constants.vbCrLf)昏暗的dt作为DateTime =取得时间(时间戳)s =" #日期:"& dt.ToString (“yyyy-MM-dd HH: mm: ss”)& Constants.vbCrLfWriteString (s)s =“#字段:“如果(m_fieldsCInt(W3CLOG。日期))=CInt(W3CLOG。日期)然后s & =“日期”结束如果如果(m_fieldsCInt(W3CLOG.time)) =CInt(W3CLOG.time)然后s & =“时间”结束如果如果(m_fieldsCInt(W3CLOG.s_sitename)) =CInt(W3CLOG.s_sitename)然后s & =“s-sitename”结束如果如果(m_fieldsCInt(W3CLOG.s_computername)) =CInt(W3CLOG.s_computername)然后s & =“s-computername”结束如果如果(m_fieldsCInt(W3CLOG.s_ip)) =CInt(W3CLOG.s_ip)然后s & =“s-ip”结束如果如果(m_fieldsCInt(W3CLOG.cs_method)) =CInt(W3CLOG.cs_method)然后s & =“cs方法”结束如果如果(m_fieldsCInt(W3CLOG.cs_uri_stem)) =CInt(W3CLOG.cs_uri_stem)然后s & =“cs-uri-stem”结束如果如果(m_fieldsCInt(W3CLOG.cs_uri_query)) =CInt(W3CLOG.cs_uri_query)然后s & =“cs-uri-query”结束如果如果(m_fieldsCInt(W3CLOG.s_port)) =CInt(W3CLOG.s_port)然后s & =“s-port”结束如果如果(m_fieldsCInt(W3CLOG.cs_username)) =CInt(W3CLOG.cs_username)然后s & =“cs-username”结束如果如果(m_fieldsCInt(W3CLOG.c_ip)) =CInt(W3CLOG.c_ip)然后s & =“c-ip”结束如果如果(m_fieldsCInt(W3CLOG.cs_version)) =CInt(W3CLOG.cs_version)然后s & =“cs-version”结束如果如果(m_fieldsCInt(W3CLOG.cs_user_agent)) =CInt(W3CLOG.cs_user_agent)然后s & =“cs(用户代理)”结束如果如果(m_fieldsCInt(W3CLOG.cs_cookie)) =CInt(W3CLOG.cs_cookie)然后s & =“cs(饼干)”结束如果如果(m_fieldsCInt(W3CLOG.cs_referer)) =CInt(W3CLOG.cs_referer)然后s & =“cs(推荐人)”结束如果如果(m_fieldsCInt(W3CLOG.cs_host)) =CInt(W3CLOG.cs_host)然后s & =“cs-host”结束如果如果(m_fieldsCInt(W3CLOG.sc_status)) =CInt(W3CLOG.sc_status)然后s & =“sc-status”结束如果如果(m_fieldsCInt(W3CLOG.sc_substatus)) =CInt(W3CLOG.sc_substatus)然后s & =“sc-substatus”结束如果如果(m_fieldsCInt(W3CLOG.sc_win32_status)) =CInt(W3CLOG.sc_win32_status)然后s & =“sc-win32-status”结束如果如果(m_fieldsCInt(W3CLOG.sc_bytes)) =CInt(W3CLOG.sc_bytes)然后s & =“sc-bytes”结束如果如果(m_fieldsCInt(W3CLOG.cs_bytes)) =CInt(W3CLOG.cs_bytes)然后s & =“cs-bytes”结束如果如果(m_fieldsCInt(W3CLOG.time_taken)) =CInt(W3CLOG.time_taken)然后s & =“时间”结束如果s & = Constants.vbCrLfWriteString (s)m_sw.Flush ()返回真正的结束函数私人函数逃避(按值传递年代作为字符串)作为字符串昏暗的t作为字符串=”“每一个c作为字符年代如果(字符.IsControl (c))需要说明(字符.IsWhiteSpace (c))然后t & = c其他的t & =“+”结束如果下一个c返回t结束函数公共InitializeLog (按值传递时间戳作为)实现了ILtmsLogHandler.InitializeLogCreateLog(时间戳)结束公共TerminateLog ()实现了ILtmsLogHandler.TerminateLog如果m_sw没有什么然后m_sw.Close ()结束如果结束公共LogInformation (按值传递信息作为ILtmsLogInformation)实现了ILtmsLogHandler.LogInformation昏暗的年代作为字符串=”“如果(m_enable)然后返回结束如果检查是否我们需要滚到一个新文件昏暗的dt作为DateTime =取得时间(info.TimeStamp)如果m_sw没有什么OrElsedt。天< > m_dtfile.DayOrElsedt。月< > m_dtfile.MonthOrElsedt。年的< > m_dtfile.Year然后如果(CreateLog (info.TimeStamp))然后返回结束如果结束如果如果(m_fieldsCInt(W3CLOG。日期))=CInt(W3CLOG。日期)然后昏暗的dtDate作为DateTime =取得时间(info.TimeStamp)如果年代。长度> 0然后s & =”“结束如果& = dtDate.ToString (“yyyy-MM-dd”)结束如果如果(m_fieldsCInt(W3CLOG.time)) =CInt(W3CLOG.time)然后昏暗的dtTime作为DateTime =取得时间(info.TimeStamp)如果年代。长度> 0然后s & =”“结束如果& = dtTime.ToString (“HH: mm: ss”)结束如果如果(m_fieldsCInt(W3CLOG.s_sitename)) =CInt(W3CLOG.s_sitename)然后昏暗的str作为字符串= info.SiteName如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.s_computername)) =CInt(W3CLOG.s_computername)然后昏暗的str作为字符串= info.ComputerName如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.s_ip)) =CInt(W3CLOG.s_ip)然后昏暗的str作为字符串= info.ServerIP如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_method)) =CInt(W3CLOG.cs_method)然后昏暗的str作为字符串= info.Method如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_uri_stem)) =CInt(W3CLOG.cs_uri_stem)然后昏暗的str作为字符串= info.URIStem如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_uri_query)) =CInt(W3CLOG.cs_uri_query)然后昏暗的str作为字符串= info.URIQuery如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.s_port)) =CInt(W3CLOG.s_port)然后昏暗的n作为整数= info.ServerPort如果年代。长度> 0然后s & =”“结束如果s & = n.ToString ()结束如果如果(m_fieldsCInt(W3CLOG.cs_username)) =CInt(W3CLOG.cs_username)然后昏暗的str作为字符串= info.UserName如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.c_ip)) =CInt(W3CLOG.c_ip)然后昏暗的str作为字符串= info.ClientIP如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_version)) =CInt(W3CLOG.cs_version)然后昏暗的str作为字符串= info.ProtocolVersion如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_user_agent)) =CInt(W3CLOG.cs_user_agent)然后昏暗的str作为字符串= info.UserAgent如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_cookie)) =CInt(W3CLOG.cs_cookie)然后昏暗的str作为字符串= info.Cookie如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_referer)) =CInt(W3CLOG.cs_referer)然后昏暗的str作为字符串= info.Referrer如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_host)) =CInt(W3CLOG.cs_host)然后昏暗的str作为字符串= info.Host如果年代。长度> 0然后s & =”“结束如果如果str.Length = 0然后s & =“-”其他的& =逃脱(str)结束如果结束如果如果(m_fieldsCInt(W3CLOG.sc_status)) =CInt(W3CLOG.sc_status)然后昏暗的n作为整数= info.Status如果年代。长度> 0然后s & =”“结束如果s & = n.ToString ()结束如果如果(m_fieldsCInt(W3CLOG.sc_substatus)) =CInt(W3CLOG.sc_substatus)然后昏暗的n作为整数= info.ProtocolSubStatus如果年代。长度> 0然后s & =”“结束如果s & = n.ToString ()结束如果如果(m_fieldsCInt(W3CLOG.sc_win32_status)) =CInt(W3CLOG.sc_win32_status)然后昏暗的n作为整数= info.Win32Status如果年代。长度> 0然后s & =”“结束如果s & = n.ToString ()结束如果如果(m_fieldsCInt(W3CLOG.sc_bytes)) =CInt(W3CLOG.sc_bytes)然后昏暗的n作为整数= info.BytesSent如果年代。长度> 0然后s & =”“结束如果如果n < 0然后s & =“-”其他的s & = n.ToString ()结束如果结束如果如果(m_fieldsCInt(W3CLOG.cs_bytes)) =CInt(W3CLOG.cs_bytes)然后昏暗的n作为整数= info.BytesReceived如果年代。长度> 0然后s & =”“结束如果如果n < 0然后s & =“-”其他的s & = n.ToString ()结束如果结束如果如果(m_fieldsCInt(W3CLOG.time_taken)) =CInt(W3CLOG.time_taken)然后昏暗的n作为整数= info.TimeTaken如果年代。长度> 0然后s & =”“结束如果如果n < 0然后s & =“-”其他的s & = n.ToString ()结束如果结束如果s & = Constants.vbCrLfWriteString (s)m_sw.Flush ()结束结束公共_server作为服务器=没有什么公共_result作为布尔=公共W3CLogHandlerExample ()试一试昏暗的enumState作为状态昏暗的_loghandler作为CW3CLogHandler“创建服务器对象的一个实例_server =Leadtools.MediaStreaming.Server ()“创建日志处理程序_loghandler =CW3CLogHandler (“ltmsServer_”,“LEADTOOLS流媒体服务器”,真正的,“% ltmsLogFolder %”0,)设置日志处理程序_server。ILogHandler = _loghandler出于演示,比较我们刚刚设置的界面昏暗的ihandler作为ILtmsLogHandler =没有什么ihandler = _server.ILogHandler如果ihandlerCType(_loghandler ILtmsLogHandler)然后_result =返回结束如果“加载配置文件位于配置文件夹下的可执行的文件夹本节”或评论运行服务器的默认设置_server.ImportConfigFile (“% ltmsConfigFolder % \ LeadtoolsMediaStreamingServer.xml”)“启动服务器_server.Start ()“确认演示目的的运行状态enumState = _server.State如果enumState = State.Started然后显示一条消息,服务器正在运行,等待好MessageBox.Show (“服务器已经开始。按OK停止。”,“LEADTOOLS流媒体的例子”,MessageBoxButtons。好的,MessageBoxIcon.Information)结束如果“停止服务器_server。停止()“删除日志处理程序_server。ILogHandler =没有什么_result =真正的e1作为异常_result =结束试一试结束
需求

目标平台

Leadtools.MediaStreaming作为年代embly
188金宝搏的网址客服|支持|联系我们|知识产权的通知
©1991 - 2021领先的技术公司。保留所有权利。