<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Control Language="vb" %> <script runat="server"> Dim objConnection As SqlConnection Dim myDataReader As SqlDataReader Dim strConn As System.Configuration.ConfigurationSettings Dim objAdapter As System.Data.SqlClient.SqlDataAdapter Dim objDataSet As DataSet Sub Page_Load(S As Object, E As EventArgs) ' Set up our connection. objConnection = New SqlClient.SqlConnection(strConn.AppSettings("Siteops")) Dim objCommand As SqlCommand ' Create new command object passing it our SQL query ' and telling it which connection to use. objCommand = New SqlCommand("SELECT Filtername, SUM(hits) AS Hits, SUM(Bytes) AS Bytes FROM TCC_STATS GROUP BY SortOrder,Filtername Order by SortOrder ASC, Filtername ASC", objConnection) objAdapter = New System.Data.SqlClient.SqlDataAdapter(objCommand) objDataSet = New DataSet objAdapter.Fill(objDataSet) myDataGrid.DataSource = objDataSet myDataGrid.DataBind() ' Open the connection, execute the command, and close the connection. objConnection.Open() myDataReader = objCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection) GetStatus() GetVersions() End Sub Sub GetStatus() Dim i i=0 Dim myConnection As New SqlClient.SqlConnection(strConn.AppSettings("Siteops")) Dim myQuery As String = "SELECT KeyValue FROM TCC_Config WHERE KeyName like'Spam%' order by KeyValue ASC" Dim myCommand As New SqlClient.SqlCommand(myQuery) myCommand.Connection = myConnection myConnection.Open() Dim MyReader As SqlClient.SqlDataReader MyReader = myCommand.ExecuteReader Label1.Text="<div align=""center""><span style=""font-family:Verdana;font-size=11px;font-weight:bold"">Statistics Collection Started: " While MyReader.Read() Label1.Text =Label1.Text & MyReader.GetValue(0) if i=0 then Label1.Text =Label1.Text & "<br>Statistics Collection Last Updated: " End If i=i+1 End While Label1.Text =Label1.Text & "</span></div>" MyReader.Close() myConnection.Close() End Sub Sub GetVersions() Dim myConnection As New SqlClient.SqlConnection(strConn.AppSettings("Siteops")) Dim myQuery As String = "SELECT KeyValue, KeyName FROM TCC_Config WHERE KeyName like'Ver%' order by KeyValue ASC" Dim myCommand As New SqlClient.SqlCommand(myQuery) myCommand.Connection = myConnection myConnection.Open() Dim MyReader As SqlClient.SqlDataReader MyReader = myCommand.ExecuteReader While MyReader.Read() Select Case trim(MyReader.GetValue(1)) Case "Version_AVG" AVGVer.Text = "<a href=http://www.topcatcomputing.com/affiliateclick.aspx?aid=1 targert=_blank>" & trim(MyReader.GetValue(0)) & "</a>" Case "Version_VDB" VDBVer.Text = trim(MyReader.GetValue(0)) Case "Version_ArGo" ArGoVER.Text = trim(MyReader.GetValue(0)) Case "Version_EW" EWVER.Text = trim(MyReader.GetValue(0)) Case "Version_MF" MFVER.Text = trim(MyReader.GetValue(0)) Case "Version_Paranoid" ParaVER.Text = trim(MyReader.GetValue(0)) End Select End While MyReader.Close() myConnection.Close() End Sub </script> <div align="center"> <table width="75%" cellspacing=2 cellpadding=2 border=0> <tr><td colspan=4><div align="center"><span style="font-family:Verdana;font-size:16pt;font-weight:bold;color:blue">Mail Server Email Statistics</span></div></td></tr> <tr><td colspan=4><asp:literal id="label1" runat="server" /><br> </td></tr> <tr><td colspan=4><div align="center"><ASP:DataGrid id="MyDataGrid" runat="server" BorderColor="black" BorderWidth="2" GridLines="Both" BorderStyle="solid" AutoGenerateColumns="False" Width="99%" cellpadding="5" cellspacing="0" > <HeaderStyle BackColor="Blue" ForeColor="White" Font-Name="Verdana" Font-Size="10pt"> </HeaderStyle> <AlternatingItemStyle BackColor="Silver" ForeColor="Black" Font-Name="Verdana" Font-Size="10pt"> </AlternatingItemStyle> <ItemStyle ForeColor="Black" Font-Name="Verdana" Font-Size="10pt"> </ItemStyle> <Columns> <asp:BoundColumn HeaderText="Filter Name" DataField="FilterName"> </asp:BoundColumn> <asp:BoundColumn HeaderText="Hit Count" DataField="Hits" DataFormatString="{0:###,###,###,###}" > <ItemStyle HorizontalAlign="right" /> </asp:BoundColumn> </Columns> </ASP:DataGrid> </div></td></tr> <tr> <td><span style="font-family:Verdana;font-size=11px;font-weight:normal">The above data was collected using <a href="http://www.argosoft.com/RootPages/MailServerNET/Default.aspx" target="_blank">ArGo Software Designs Mail Server .NET Edition version <asp:literal id="ArGoVer" runat="server" /></a> and the <a href="http://www.sssolutions.net/ew/" target="_blank">Server Side Solutions eWall version <asp:literal id="EWVer" runat="server" /></a> programmable Gateway with <a href="http://www.sssolutions.net/paranoid/" target="_blank"> Paranoid version <asp:literal id="ParaVer" runat="server" /></a> spam filter.<br.<br>The orginal <a href="http://www.topcatcomputing.com/Articles/tabid/54/articleType/ArticleView/articleId/4/What-is-Spam-Stats.aspx">What is Spam Stats?</a> article was based on <a href="http://www.argosoft.com/RootPages/MailServer/Default.aspx" target="_blank">ArGo Software designs Mail Server Pro Win32 Edition</a> and <a href="http://www.sssolutions.net/mf/" target="_blank">Server Side Soltions Mail Filter Pro</a> using <a href="http://www.mysql.com/" target="_blank">MySQL</a> as the database.<br><br> We have since move to the <a href="http://www.argosoft.com/RootPages/MailServerNET/Default.aspx" target="_blank">ArGo Software Design Mail Server .NET Edition</a>, upgraded to <a href="http://www.sssolutions.net/ew/" target="_blank">Server Side Solutions eWall</a> and ported our scripts to work with <a href="http://www.microsoft.com/sql/default.mspx" target="_blank">MS-SQL</a>. We also have <a href="http://www.sssolutions.net/mf/" target="_blank">Server Side Solutions Mail Filter Pro version <asp:literal id="MFVer" runat="server" /></a> installed for testing and development purposes. <br><br>All Top Cat Computing servers are scanned and protected by <asp:literal id="AVGVer" runat="server" /> using virus database <asp:literal id="VDBVer" runat="server" />.<br><br>For more information, please see <a href="http://www.topcatcomputing.com/Articles/tabid/54/articleType/ArticleView/articleId/4/What-is-Spam-Stats.aspx">What is Spam Stats?</a>. </span></td></tr> </table> </div>