Exemplo n.º 1
0
        private string DoDnsLookup()
        {
            StringBuilder sb = new StringBuilder(64);

            foreach (DnsQuery query in this.m_dnsQueries)
            {
                string str;
                switch (query.QueryType)
                {
                case DnsRecordType.SRV:
                    str = "-querytype=SRV";
                    break;

                case DnsRecordType.A:
                    str = "-querytype=A";
                    break;

                default:
                    str = "";
                    break;
                }
                string text1 = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\cmd.exe";
                string str2  = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\nslookup.exe";
                this.m_process.Filename        = str2;
                this.m_process.Args            = str + " " + query.Record;
                this.m_process.WindowStyle     = System.Diagnostics.ProcessWindowStyle.Hidden;
                this.m_process.UseShellExecute = false;
                sb.Append("\nAbout to issue query for record: " + query.Record + "\n");
                this.m_process.RunProcess();
                ParseDnsResult result = new ParseDnsResult(query, this.m_process.ProcessOutput);
                sb.Append("Finished DNS query. About to parse the results.\n");
                DnsResult dnsResult = result.m_dnsResult;

                if (dnsResult.foundRecord)
                {
                    this.listViewMatch.Add(dnsResult);
                }
                else
                {
                    this.listViewNoMatch.Add(dnsResult);
                }
            }
            return(sb.ToString());
        }
Exemplo n.º 2
0
        private string DoDnsLookup()
        {
            StringBuilder sb = new StringBuilder(64);

            foreach (DnsQuery query in this.m_dnsQueries)
            {
                string str;
                switch (query.QueryType)
                {
                    case DnsRecordType.SRV:
                        str = "-querytype=SRV";
                        break;

                    case DnsRecordType.A:
                        str = "-querytype=A";
                        break;

                    default:
                        str = "";
                        break;
                }
                string text1 = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\cmd.exe";
                string str2 = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\nslookup.exe";
                this.m_process.Filename = str2;
                this.m_process.Args = str + " " + query.Record;
                this.m_process.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                this.m_process.UseShellExecute = false;
                sb.Append("\nAbout to issue query for record: " + query.Record + "\n");
                this.m_process.RunProcess();
                ParseDnsResult result = new ParseDnsResult(query, this.m_process.ProcessOutput);
                sb.Append("Finished DNS query. About to parse the results.\n");
                DnsResult dnsResult = result.m_dnsResult;

                if (dnsResult.foundRecord)
                {
                    this.listViewMatch.Add(dnsResult);
                }
                else
                {
                    this.listViewNoMatch.Add(dnsResult);
                }
            }
            return sb.ToString();
        }