📄 testdnsmagic.htm
字号:
<HTML>
<HEAD>
<TITLE>Test DNS Magic (SMTP) in HTML/VBScript</TITLE>
<SCRIPT LANGUAGE="VBScript">
Sub Autoload()
Dim oDNS
Set oDNS = CreateObject("Emmanuel.SimpleDNSClient.1")
Dim server_name
oDNS.FindServerAddresses server_name
document.forms("DNS_FORM").item("SERVER").value = server_name
Dim domain
oDNS.GetDNSDomain domain
document.forms("DNS_FORM").item("REQUESTED_NAME").value = domain
MsgBox "DNS Servers: " + vbCrLf + server_name + vbCrLf + vbCrLf + _
"DNS Domain: " + vbCrLf + domain
Set oDNS = Nothing
End Sub
Sub Resolve()
Dim oDNS
Set oDNS = CreateObject("Emmanuel.SimpleDNSClient.1")
Dim server_name
server_name = document.forms("DNS_FORM").item("SERVER").value
Dim requested_name
requested_name = document.forms("DNS_FORM").item("REQUESTED_NAME").value
Dim separator
separator = document.forms("DNS_FORM").item("SEPARATOR").value
Dim found_names
found_names = ""
' Set the server address(es) [optional on Windows NT, mandatory on Win95/98]
oDNS.ServerAddresses = server_name
oDNS.Separator = separator
On Error Resume Next
oDNS.GetEmailServers requested_name, found_names
If Err <> 0 Then
MsgBox Err.Description
Else
' Show resolved names (within current page)
DNS_OUTPUT.innerHTML = found_names
' Show resolved names (within dialog box)
'MsgBox "Found names:" & vbCrLf & vbCrLf & found_names
End If
Set oDNS = Nothing
End Sub
</SCRIPT>
</HEAD>
<BODY>
<CENTER><H2>Test DNS Magic (SMTP) in HTML/VBScript</H2></CENTER>
<P><FONT COLOR=RED><U>CAUTION:</U></FONT> the SimpleDNSResolver COMponent must have been registered on your machine
to be able to use this page.</P>
<P>This page will let you test the DNS Magic regarding SMTP. If you're connected to a <EM>well configured TCP/IP
network</EM>, the DNSResolverClient component will <B>find all the declared SMTP servers</B> in your domain. You should
be able to send email using their names.</P>
<P>Optionally, you can specify the IP address of your DNS server (if you don't, the component will find the
address in your machine's configuration/registry).<BR>
Optionally, you can specify a Domain Name (if you don't, the component will find the domain name of your machine
in its configuration/registry).<BR>
If you click on the "Autoinitialize" button below, the form will be automatically filled with your machine's domain and the DNS servers.</P>
<P><INPUT TYPE=BUTTON VALUE="Auto-Initialize" OnClick="Autoload"></P>
<P><HR></P>
<FORM NAME="DNS_FORM">
<TABLE>
<TR>
<TD>DNS Server:</TD>
<TD><INPUT TYPE=TEXT NAME=SERVER SIZE=32 VALUE=""></TD>
</TR>
<TR>
<TD>Requested Resource Class:</TD>
<TD>C_IN: ARPA Internet</TD>
</TR>
<TR>
<TD>Requested Resource Type:</TD>
<TD>T_MX: mail routing information</TD>
</TR>
<TR>
<TD>IP Domain Name<BR>(empty string to use your machine's domain):</TD>
<TD><INPUT TYPE=TEXT NAME="REQUESTED_NAME" SIZE=48 VALUE=""></TD>
</TR>
<TR>
<TD>Separator for multiple values:</TD>
<TD><INPUT TYPE=TEXT NAME="SEPARATOR" SIZE=8 VALUE=", "></TD>
</TR>
</TABLE>
<P><CENTER><INPUT TYPE=BUTTON VALUE="Get Email Servers" OnClick="Resolve"></CENTER></P>
</FORM>
<P><HR></P>
<P>
Resolved Names:
</P>
<DIV ID="DNS_OUTPUT">
<!-- This is for output -->
</DIV>
<P><HR></P>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -