本文整理汇总了C#中Cmdlet.WriteDebug方法的典型用法代码示例。如果您正苦于以下问题:C# Cmdlet.WriteDebug方法的具体用法?C# Cmdlet.WriteDebug怎么用?C# Cmdlet.WriteDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cmdlet
的用法示例。
在下文中一共展示了Cmdlet.WriteDebug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendDnsQuery
public static List<DnsRecord> SendDnsQuery(Cmdlet HostCmdlet, string NameQueried, RecordType DNSQueryType, string[] DNSServerAddresses, api.QueryParameters Switches)
{
List<string> strs = new List<string>();
QueryOptions queryOption = QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_ALLOW_EMPTY_AUTH_RESP | QueryOptions.DNS_QUERY_FALLBACK_NETBIOS;
api.ValidateParameters(Switches);
if (Switches.DnsOnly)
{
queryOption = QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_HOSTS_FILE | QueryOptions.DNS_QUERY_NO_NETBT | QueryOptions.DNS_QUERY_WIRE_ONLY | QueryOptions.DNS_QUERY_NO_MULTICAST | QueryOptions.DNS_QUERY_TREAT_AS_FQDN | QueryO ... //#注:代码行过长, 已省略后续字符...
}
if (Switches.CacheOnly)
{
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptions.DNS_QUERY_NO_LOCAL_NAME | QueryOpti ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption | QueryOptions.DNS_QUERY_NO_WIRE_QUERY;
queryOption = queryOption | QueryOptions.DNS_QUERY_CACHE_NO_FLAGS_MATCH;
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
}
if (Switches.DnssecOk)
{
queryOption = queryOption | QueryOptions.DNS_QUERY_DNSSEC_OK;
}
if (Switches.DnssecCd)
{
queryOption = queryOption | QueryOptions.DNS_QUERY_DNSSEC_CHECKING_DISABLED;
}
if (Switches.NoHostsFile)
{
queryOption = queryOption | QueryOptions.DNS_QUERY_NO_HOSTS_FILE;
}
if (Switches.LlmnrNetbiosOnly)
{
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption | QueryOptions.DNS_QUERY_MULTICAST_ONLY;
queryOption = queryOption | QueryOptions.DNS_QUERY_FALLBACK_NETBIOS;
}
if (Switches.LlmnrFallback)
{
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
}
if (Switches.LlmnrOnly)
{
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption | QueryOptions.DNS_QUERY_MULTICAST_ONLY;
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
}
if (Switches.NetbiosFallback)
{
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption & (QueryOptions.DNS_QUERY_ACCEPT_TRUNCATED_RESPONSE | QueryOptions.DNS_QUERY_USE_TCP_ONLY | QueryOptions.DNS_QUERY_NO_RECURSION | QueryOptions.DNS_QUERY_BYPASS_CACHE | QueryOptions.DNS_QUERY_NO_WIRE_QUERY | QueryOptio ... //#注:代码行过长, 已省略后续字符...
queryOption = queryOption | QueryOptions.DNS_QUERY_FALLBACK_NETBIOS;
}
if (Switches.NoIdn)
{
queryOption = queryOption | QueryOptions.DNS_QUERY_DISABLE_IDN_ENCODING;
}
if (Switches.NoRecursion)
{
queryOption = queryOption | QueryOptions.DNS_QUERY_NO_RECURSION;
}
if (Switches.QuickTimeout)
{
queryOption = queryOption | QueryOptions.DNS_QUERY_USE_QUICK_TIMEOUTS;
}
if (Switches.TcpOnly)
{
queryOption = queryOption | QueryOptions.DNS_QUERY_USE_TCP_ONLY;
}
if (strs.Count == 0)
{
strs.Add(NameQueried);
}
if (DNSServerAddresses != null)
{
for (int i = 0; i < (int)DNSServerAddresses.Length; i++)
{
DNSServerAddresses[i] = Dns.GetHostAddresses(DNSServerAddresses[i])[0].ToString();
}
}
List<DnsRecord> dnsRecords = new List<DnsRecord>();
foreach (string str in strs)
{
try
{
if (DNSQueryType != RecordType.UNKNOWN)
{
dnsRecords.AddRange(win32.GetDNSRecords(str, DNSServerAddresses, queryOption, DNSQueryType));
}
else
{
dnsRecords.AddRange(win32.GetDNSRecords(str, DNSServerAddresses, queryOption | QueryOptions.DNS_QUERY_DUAL_ADDR, RecordType.AAAA));
}
if (HostCmdlet != null)
{
object[] array = dnsRecords.ToArray();
HostCmdlet.WriteVerbose(str);
HostCmdlet.WriteDebug(queryOption.ToString());
object[] objArray = array;
//.........这里部分代码省略.........