📄 csimplednsclient.html
字号:
<html><head><title>CSimpleDNSClient Documentation</title></head>
<body><h1>
<a name="topofdoc"><img src="logo.gif">CSimpleDNSClient</a></h1>
<dl>
<dd>
COM (ActiveX) object implementing ISimpleDNSClient, a DNS resolver.
</dl>
<hr><p></p>
<p><strong>[
<a href="SimpleDNSResolver.html">SimpleDNSResolver</a> |
<a href="SimpleDNSClient.h">Source</a> |
<a href="/keyweb.html">Keywords</a> |
<a href="#aag">Summary</a> | <a href="#parents">Ancestors</a> | <a href="#flat">All Members</a> | <a href="#children">Descendants</a> ]</strong><p>
<h2><a name="quickind">Quick Index</a></h2>
<dl>
<dd><a href="#DESCRIPTION">DESCRIPTION</a>
<dd><a href="#USAGE">USAGE</a>
<dd><a href="#EXAMPLE">EXAMPLE</a>
<dd><a href="#ADMINISTRATIVE">ADMINISTRATIVE</a>
<dd><a href="#SEE_ALSO">SEE ALSO</a>
</dl>
<a name="aag"><hr><p></p></a><h2>Class Summary</h2>
class ATL_NO_VTABLE CSimpleDNSClient :<br>
public CComObjectRootEx<CComMultiThreadModel>,<br>
public CComCoClass<CSimpleDNSClient, &CLSID_SimpleDNSClient>,<br>
public ISupportErrorInfo,<br>
public IDispatchImpl<ISimpleDNSClient, &IID_ISimpleDNSClient, &LIBID_SIMPLEDNSRESOLVERLib><br>
<br>
{
<br>
<br><i><b>public</b></i>:
<dl>
<dd><a href="CSimpleDNSClient.html#CSimpleDNSClient()_$"><font color=green>CSimpleDNSClient</font></a>() ;
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(FindServerAddresses)(VARIANT_*pvServerAddresses)$"><font color=green>FindServerAddresses</font></a>)(VARIANT *pvServerAddresses);
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(get_ServerAddresses)(_BSTR_*pVal)$"><font color=green>get_ServerAddresses</font></a>)( BSTR *pVal);
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(put_ServerAddresses)(_BSTR_newVal)$"><font color=green>put_ServerAddresses</font></a>)( BSTR newVal);
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(Resolve)(_BSTR_BSearchedName,_VARIANT_*pvFoundNames,_BSTR_BResourceClass,_BSTR_BResourceType)$"><font color=green>Resolve</font></a>)( BSTR BSearchedName, VARIANT *pvFoundNames, BSTR BResourceClass, BSTR BResourceType);
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(GetEmailServers)(_BSTR_BDomainName,_VARIANT_*pvEmailServerNames)$"><font color=green>GetEmailServers</font></a>)( BSTR BDomainName, VARIANT *pvEmailServerNames);
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(get_Separator)(_BSTR_*pVal)$"><font color=green>get_Separator</font></a>)( BSTR *pVal);
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(put_Separator)(_BSTR_newVal)$"><font color=green>put_Separator</font></a>)( BSTR newVal);
<dd>STDMETHOD(<a href="CSimpleDNSClient.html#STDMETHOD(GetDNSDomain)(_VARIANT_*pvDNSDomainName)$"><font color=green>GetDNSDomain</font></a>)( VARIANT *pvDNSDomainName);
</dl>
<i><b>protected</b></i>:
<dl>
</dl>
}; // CSimpleDNSClient <p>
<p>Back to the <a href="#topofdoc">top</a> of <i>CSimpleDNSClient</i><p>
<a name="DESCRIPTION"><hr><p></p></a><h3>DESCRIPTION</h3>
<p>
This class implements a DNS resolver within a COM object. It
relies on a porting of the BIND (Berkeley Internet Name Domain)
implementation of DNS.
<p>
<p>Back to the <a href="#topofdoc">top</a> of <i>CSimpleDNSClient</i><p>
<a name="USAGE"><hr><p></p></a><h3>USAGE</h3>
<p>
To use this class:
<UL>
<LI>Create an instance of the COMponent
<LI>Call any method of the ISimpleDNSClient interface:
<UL>
<LI><a href="#STDMETHOD(Resolve)(_BSTR_BSearchedName,_VARIANT_*pvFoundNames,_BSTR_BResourceClass,_BSTR_BResourceType)$">Resolve</a>()
<LI><a href="#STDMETHOD(GetEmailServers)(_BSTR_BDomainName,_VARIANT_*pvEmailServerNames)$">GetEmailServers</a>()
<LI><a href="#STDMETHOD(FindServerAddresses)(VARIANT_*pvServerAddresses)$">FindServerAddresses</a>()
<LI><a href="#STDMETHOD(get_ServerAddresses)(_BSTR_*pVal)$">get_ServerAddresses</a>()
<LI><a href="#STDMETHOD(put_ServerAddresses)(_BSTR_newVal)$">put_ServerAddresses</a>()
<LI><a href="#STDMETHOD(get_Separator)(_BSTR_*pVal)$">get_Separator</a>()
<LI><a href="#STDMETHOD(put_Separator)(_BSTR_newVal)$">put_Separator</a>()
<LI><a href="#STDMETHOD(GetDNSDomain)(_VARIANT_*pvDNSDomainName)$">GetDNSDomain</a>()
</UL>
<LI>Delete instance of COMponent
</UL>
<p>
<p>Back to the <a href="#topofdoc">top</a> of <i>CSimpleDNSClient</i><p>
<a name="EXAMPLE"><hr><p></p></a><h3>EXAMPLE</h3>
<p>
<PRE>
Dim oDNS
Set oDNS = CreateObject("Emmanuel.SimpleDNSClient.1")
<p>
Dim requested_name
requested_name = "www.microsoft.com"
<p>
Dim found_names
found_names = ""
<p>
' Set the server address(es) [optional on Windows NT, mandatory on Win95/98]
oDNS.ServerAddresses = "99.99.99.99"
' Set the separator
oDNS.Separator = ";"
<p>
On Error Resume Next
oDNS.GetEmailServers requested_name, found_names
If Err <> 0 Then
MsgBox Err.Description
Else
' Show resolved names (within dialog box)
MsgBox "Found names:" & vbCrLf & vbCrLf & found_names
End If
</PRE>
<p>
<p>Back to the <a href="#topofdoc">top</a> of <i>CSimpleDNSClient</i><p>
<a name="ADMINISTRATIVE"><hr><p></p></a><h3>ADMINISTRATIVE</h3>
<p>
Author Emmanuel KARTMANN <emmanuel@kartmann.org>
<p>
Date Monday 1/31/00 3:52:04 PM
<p>
<p>Back to the <a href="#topofdoc">top</a> of <i>CSimpleDNSClient</i><p>
<a name="SEE_ALSO"><hr><p></p></a><h3>SEE ALSO</h3>
<p>
<A HREF="http://www.ietf.org/rfc/rfc1034.txt">RFC1034</A>,<BR>
<A HREF="http://www.ietf.org/rfc/rfc1035.txt">RFC1035</A>.
<p>
<p>Back to the <a href="#topofdoc">top</a> of <i>CSimpleDNSClient</i><p>
<a name="CSimpleDNSClient()_$"><hr><p></p><h3>CSimpleDNSClient() ;</h3></a>
<p>
<U>Purpose:</U> create an instance of the class
<p>
<U>Parameters:</U> none (C++ constructor)
<p>
<U>Return value :</U> none (C++ constructor)
<p>
<U>Description :</U>
<p>
<p><pre>
<a href="#CSimpleDNSClient()_$">CSimpleDNSClient</a>()
;</pre>
<p><em>Function is currently defined <strong>inline</strong>.</em></p>
<br><p>Back to the <a href="#topofdoc">top</a> of <i> CSimpleDNSClient </i> <p>
<a name="STDMETHOD(FindServerAddresses)(VARIANT_*pvServerAddresses)$"><hr><p></p><h3>STDMETHOD(FindServerAddresses)(VARIANT *pvServerAddresses);</h3></a>
<p>
<U>Purpose:</U> return the known DNS server addresses,
as configured in your local machine (Windows Registry)
<p>
<U>Parameters:</U>
<p>
<dl><dl>
<dt><i>out</i><strong> pvServerAddresses</strong>
<dd> list of DNS Server addresses (separated by spaces),
in dotted notation, e.g. "192.175.235.1 192.175.234.2"
<p>
</dl></dl>
<U>Return value :</U> HRESULT = S_OK for success,
otherwise an error occurred
<p>
<U>Description :</U> This function reads the registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NameServer
to find the DNS servers on the local machine.
<p>
This function works on Windows NT only.
<p>
<p><pre>
STDMETHOD(FindServerAddresses)(VARIANT *pvServerAddresses);
</pre>
<br><p>Back to the <a href="#topofdoc">top</a> of <i> CSimpleDNSClient </i> <p>
<a name="STDMETHOD(get_ServerAddresses)(_BSTR_*pVal)$"><hr><p></p><h3>STDMETHOD(get_ServerAddresses)( BSTR *pVal);</h3></a>
<p>
<U>Purpose:</U> return value of the ServerAddresses property,
i.e. the list of DNS servers.
<p>
<U>Parameters:</U>
<p>
<dl><dl>
<dt><i>out</i><strong> pVal</strong>
<dd> list of DNS Server addresses (separated by spaces),
in dotted notation, e.g. "192.175.235.1 192.175.234.2"
<p>
</dl></dl>
<U>Return value :</U> HRESULT = S_OK for success,
otherwise an error occurred
<p>
<U>Description :</U> The property ServerAddresses can be set
via method <a href="#STDMETHOD(put_ServerAddresses)(_BSTR_newVal)$">put_ServerAddresses</a>().
<p>
<p><pre>
STDMETHOD(get_ServerAddresses)(/*[out, retval]*/ BSTR *pVal);
</pre>
<br><p>Back to the <a href="#topofdoc">top</a> of <i> CSimpleDNSClient </i> <p>
<a name="STDMETHOD(put_ServerAddresses)(_BSTR_newVal)$"><hr><p></p><h3>STDMETHOD(put_ServerAddresses)( BSTR newVal);</h3></a>
<p>
<U>Purpose:</U> set value of the ServerAddresses property,
i.e. the list of DNS servers.
<p>
<U>Parameters:</U>
<p>
<dl><dl>
<dt><i>in</i><strong> newVal</strong>
<dd> new list of DNS Server addresses (separated by spaces),
in dotted notation, e.g. "192.175.235.1 192.175.234.2"
<p>
</dl></dl>
<U>Return value :</U> HRESULT = S_OK for success,
otherwise an error occurred
<p>
<U>Description :</U> The property ServerAddresses can be read
via method <a href="#STDMETHOD(get_ServerAddresses)(_BSTR_*pVal)$">get_ServerAddresses</a>().
<p>
<p><pre>
STDMETHOD(put_ServerAddresses)(/*[in]*/ BSTR newVal);
</pre>
<br><p>Back to the <a href="#topofdoc">top</a> of <i> CSimpleDNSClient </i> <p>
<a name="STDMETHOD(Resolve)(_BSTR_BSearchedName,_VARIANT_*pvFoundNames,_BSTR_BResourceClass,_BSTR_BResourceType)$"><hr><p></p><h3>STDMETHOD(Resolve)( BSTR BSearchedName, VARIANT *pvFoundNames, BSTR BResourceClass, BSTR BResourceType);</h3></a>
<p>
<U>Purpose:</U> resolve a name in DNS, i.e. send a request and
build a list (string) of results with the server's
answer(s).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -