当前位置: 首页>>代码示例>>C#>>正文


C# RecordType.ToString方法代码示例

本文整理汇总了C#中RecordType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# RecordType.ToString方法的具体用法?C# RecordType.ToString怎么用?C# RecordType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RecordType的用法示例。


在下文中一共展示了RecordType.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Lookup

        /// <summary>
        /// Retrieves whois information
        /// </summary>
        /// <param name="domainName">The registrar or domain or name server whose whois information to be retrieved</param>
        /// <param name="recordType">The type of record i.e a domain, nameserver or a registrar</param>
        /// <returns></returns>
        public static string Lookup(string domainName, RecordType recordType)
        {
            string whoisServerName = WhoisServerResolver.GetWhoisServerName(domainName);
            using (TcpClient whoisClient = new TcpClient())
            {
                whoisClient.Connect(whoisServerName, Whois_Server_Default_PortNumber);

                string domainQuery = recordType.ToString() + " " + domainName + "\r\n";
                byte[] domainQueryBytes = Encoding.ASCII.GetBytes(domainQuery.ToCharArray());

                Stream whoisStream = whoisClient.GetStream();
                whoisStream.Write(domainQueryBytes, 0, domainQueryBytes.Length);

                StreamReader whoisStreamReader = new StreamReader(whoisClient.GetStream(), Encoding.ASCII);

                string streamOutputContent = "";
                List<string> whoisData = new List<string>();
                while (null != (streamOutputContent = whoisStreamReader.ReadLine()))
                {
                    whoisData.Add(streamOutputContent);
                }

                whoisClient.Close();

                return String.Join(Environment.NewLine, whoisData);
            }
        }
开发者ID:coderbuddyblog,项目名称:DomainTools,代码行数:33,代码来源:Whois.cs

示例2: Lookup

 /// <summary>
 /// retrieves whois information
 /// </summary>
 /// <param name="domainname">The registrar or domain or name server whose whois information to be retrieved</param>
 /// <param name="recordType">The type of record i.e a domain, nameserver or a registrar</param>
 /// <param name="returnlist">use "whois.internic.net" if you dont know whoisservers</param>
 /// <returns>The string list containg the whois information</returns>
 public static List<string> Lookup(string domainname, RecordType recordType, string whois_server_address = "whois.internic.net")
 {
     TcpClient tcp = new TcpClient();
     tcp.Connect(whois_server_address, 43);
     string strDomain = recordType.ToString() + " " + domainname + "\r\n";
     byte[] bytDomain = Encoding.ASCII.GetBytes(strDomain.ToCharArray());
     Stream s = tcp.GetStream();
     s.Write(bytDomain, 0, strDomain.Length);
     StreamReader sr = new StreamReader(tcp.GetStream(), Encoding.ASCII);
     string strLine = "";
     List<string> result = new List<string>();
     while (null != (strLine = sr.ReadLine()))
     {
         result.Add(strLine);
     }
     tcp.Close();
     return result;
 }
开发者ID:yinghuabaibai,项目名称:chinalist,代码行数:25,代码来源:Whois.cs

示例3: Whois_lookup

 public static string Whois_lookup(string domainname, RecordType recordType)
 {
     string whois_server_address = "whois.internic.net";
     TcpClient tcp = new TcpClient();
     tcp.Connect(whois_server_address, 43);
     string strDomain = recordType.ToString() + " " + domainname + "\r\n";
     byte[] bytDomain = Encoding.ASCII.GetBytes(strDomain.ToCharArray());
     Stream s = tcp.GetStream();
     s.Write(bytDomain, 0, strDomain.Length);
     var sr = new StreamReader(tcp.GetStream(), Encoding.ASCII);
     string final = "";
     string strLine;
     while (null != (strLine = sr.ReadLine()))
     {
         final = final + strLine + "\n";
     }
     tcp.Close();
     return final;
 }
开发者ID:benjojo,项目名称:DomainHackGen,代码行数:19,代码来源:Program.cs

示例4: WriteDataToLog

        private static void WriteDataToLog(Device device, string content, RecordType recordType)
        {
            DateTime now = DateTime.Now;
            FileStream stream = RecordManager.GetLogFileStream(device, now);
            string time = string.Format("[{0:HH:mm:ss}] ", now);
            StringBuilder sb = new StringBuilder(time);
            sb.Append(string.Format(" <{0}> ", recordType.ToString()));
            sb.Append(content);
            sb.Append("\r\n");
            string line = sb.ToString();

            byte[] bytes = Encoding.ASCII.GetBytes(line);
            stream.Write(bytes, 0, bytes.Length);

            // Flush Control.
            if (flushCtrlCount % 10 == 0)
            {
                stream.Flush();
            }
            flushCtrlCount = (flushCtrlCount + 1) % 5;
        }
开发者ID:mrddos,项目名称:planisphere,代码行数:21,代码来源:RecordManager.cs

示例5: ImportOrganization

        public TypeOrg ImportOrganization(RecordType recordType, string clientType, string mainSpec)
        {
            OrganizationModel organizationModel = new OrganizationModel { RecordType = recordType.ToString(), ClientType = clientType, MainSpec = mainSpec };

            return new ReadFileOrganization().GetTypeOrg(organizationModel);
        }
开发者ID:BBraunRussia,项目名称:RegionalReport,代码行数:6,代码来源:UnitTest1.cs

示例6: WriteDataToLog

		private static void WriteDataToLog(Device device, string content, RecordType recordType, bool flush = false)
		{
            // To Log File
			DateTime now = DateTime.Now;
            StreamWriter fileWriter = RecordManager.GetLogFileStream(device, now);
			string time = string.Format("[{0:HH:mm:ss}] ", now);
			StringBuilder sb = new StringBuilder(time);
            sb.Append(string.Format(" <{0}> ", recordType.ToString()));
			sb.Append(content);
			string line = sb.ToString();

            fileWriter.WriteLine(line);

			// Flush Control.
#if DEBUG
            fileWriter.Flush();
#else
            if (flush)
            {
                fileWriter.Flush();
            }
#endif

			if (flushCtrlCount % 10 == 0)
			{
                fileWriter.Flush();
			}
			flushCtrlCount = (flushCtrlCount + 1) % 5;

            // To Log Console
            if (ExistLoggerConsoleProc())
            {
                string deviceKey = device.Id.ToLower();
                if (LoggerClient.Contains(deviceKey))
                {
                    logger.Send(deviceKey, line);
                }
            }
		}
开发者ID:oisy,项目名称:scada,代码行数:39,代码来源:RecordManager.cs


注:本文中的RecordType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。