Server 2008 hiberfil.sys exists…

•June 25, 2010 • Leave a Comment

Tidbit of information, I just ran out of space on a 2008 web server’s c:\ drive and found the hiberfil.sys file was 4gb… also had some log files to clear but found this information about the hiberfil.sys in a M$ forum somewhere. I executed the command on my server and it went away …

By default, in Windows Server 2008, the Hibernation feature is disabled (power options), yet the hiberfil.sys file is created. The hyberfil.sys file has the size of the servers’ physical memory, which can be many gigabytes. This is pointless because hibernation is not supposed to be used on production servers at all. A complete waste of resources. It may even be included in backups … (haven’t verified this)

At best, the hibernation feature may be used in Windows Server 2008 test/demo environments. Even there it shouldn’t be enabled by default and there shouldn’t be a hyberfil.sys file.

powercfg.exe -h off

This command worked and removed the hiberfil.sys.

I agree, it’s really not a good idea to have that by default. The excuse that it exists in case of power-failure and switch to UPS makes no sense. You don’t need hiberfil.sys to protect you from power-failure. We’ve never had a problem with a properly configured UPS setup on a server when there is a powerfailure. If you turn off hibernation, the file should go away, period! If it’s turned off by default then the file shouldnt’ exist by default. Typical MS logic. Either way, not a big deal to get around.

ASP.NET Image Rollover Using VB

•June 23, 2010 • Leave a Comment

For a simple image rollover using your vb codebehind page and a couple of png files or whatever file type you wish to use. I’m not sure where I found this bit of script but it came in handy a few weeks ago!

<asp:ImageButton runat="server" ID="tbimage" ImageUrl="img/LeftMenuButton.png" Style="float: left;
outline: 0; width: 21px" />

In your VB Codebehind page:

    Private Sub Page_Load(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles MyBase.Load

        tbimage.Attributes.Add("onMouseOver", _
        tbimage.Attributes.Add("onMouseOut", _
    End Sub

Sending Email with System.Net.Mail

•June 23, 2010 • Leave a Comment

I haven’t tested this one but I got it off of ScottGu’s blog which has some great stuff on it…

Read Scott’s Original Post

.NET 2.0 includes much richer Email API support within the System.Net.Mail code namespace. I’ve seen a few questions from folks wondering about how to get started with it. Here is a simple snippet of how to send an email message from “” to multiple email recipients (note that the To a CC properties are collections and so can handle multiple address targets):

MailMessage message = new MailMessage();
message.From = new MailAddress("");

message.To.Add(new MailAddress(""));
message.To.Add(new MailAddress(""));
message.To.Add(new MailAddress(""));

message.CC.Add(new MailAddress(""));
message.Subject = "This is my subject";
message.Body = "This is the content";

SmtpClient client = new SmtpClient();


System.Net.Mail reads SMTP configuration data out of the standard .NET configuration system (so for ASP.NET applications you’d configure this in your application’s web.config file). Here is an example of how to configure it:

      <smtp from="">
        <network host="smtpserver1" port="25" userName="username" password="secret" defaultCredentials="true" />

DNS Record Types

•June 23, 2010 • Leave a Comment

Just some DNS information that is good to understand if you are manageing dns records for a website or company…

An ‘A’ or ‘Address’ record ties a domain name to an IP address. If there is a server on the Internet that is configured to handle traffic for this domain, you can enter the name of the domain and the IP address of the server (for example ‘’) and your domain will point to that IP address.

Examples: A A

A ‘CNAME’ or ‘Common Name’ creates an alias from a domain name to another. For example, you can create a CNAME from ‘’ to ‘’, and every reference to ‘’ will go to ‘’, regardless of how changes their IP addresses.
Please note that if you define a CNAME for one of your subdomains, there should be no A or MX record defined for that subdomain.


An ‘MX’ or ‘Mail Exchange’ record is used to specify what server on the Internet is running e-mail software that is configured to handle e-mail for your domain. Additionally, if you define several MX records, the Priority lets you specify the order in which they should be tried. Mail servers with the lowest pritority will be tried first.

Examples: MX 0 MX 5 MX 0 MX 5

An ‘NS’ or ‘Name Server’ record allows you to delegate one of your subdomains to other name servers. These other name servers are responsible for providing A, MX, etc. records for the delegated subdomain. Note that to change the NS records for your base domain name (, you must do it through the domain’s registrar. To change the name servers of domains of which we are the registrar, use the “update name servers” link on our main account management page.

Examples: NS NS

A ‘TXT’ or ‘Text’ record allows you to add a comment to a domain or subdomain record that will be available through DNS. A common use for TXT records is to specify a Sender Permitted From (SPF) record for a domain. You can find more information about SPF at: or use the SPF wizard at:

Examples: TXT For Questions, contact: TXT ‘v=spf1’

ASP.NET Simple Email Form

•June 22, 2010 • 1 Comment

I was needing to create an email form and ended up finding some other issues with sending the values from checkboxlists. This was taken from several different sites, it should work with no troubles. I also added a try/catch statement to catch errors. If you have any questions, don’t hesitate to contact me. thx.

The form html code in the contactform.aspx

        <fieldset style="padding: 10px;">
            <legend style="margin-top: -10px;">Please enter your information: </legend>
            <table border="0">
                        <b>Your Name:</b>
                        <br />
                        <asp:textbox ID="txtName" runat="server" EmptyMessage="Please input your name."
                            Skin="Default" Width="200px" CausesValidation="True">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="*"
                        <b>Your Email:</b>
                        <asp:textbox ID="txtEmail" runat="server" EmptyMessage="Please input your email address."
                            Width="200px" CausesValidation="True">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                    <td colspan="2">
                        Your email address will ONLY be used to configure your account and respond appropriately.
                        <br />
                        It WILL NOT be sold, or used to send you spam.
                        <hr />
                    <td colspan="2" align="left">
                            <legend>Please select the departments you commonly work with: </legend>
                            <asp:CheckBoxList ID="txtCheckBox" runat="server" RepeatColumns="4">
                                <asp:ListItem Text="Two" />
                                <asp:ListItem Text="Three" />
                                <asp:ListItem Text="Four" />
                                <asp:ListItem Text="Five" />
                                <asp:ListItem Text="Six" />
                    <td colspan="2">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                            ControlToValidate="txtComments"></asp:RequiredFieldValidator><br />
                        <asp:textbox ID="txtComments" TextMode="MultiLine" runat="server" Width="400px"
                            Height="200px" EmptyMessage="Please tell us how we can assist you!" CausesValidation="True">
                    <td colspan="2" align="center">
                        <asp:Label ID="lblMessage" runat="server" Text="" ForeColor="Green"></asp:Label>
                        <asp:Button runat="server" ID="SendEmail" Text="Send Feedback" />

My entire VB Codebehind for contactform.aspx.vb

Partial Class accessrequest
    Inherits System.Web.UI.Page

    Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendEmail.Click
        Const ToAddress As String = ""

        '(1) Create the MailMessage instance
        Dim mm As New Net.Mail.MailMessage(txtEmail.Text, ToAddress)

        Dim strchklist As String = ""
        Dim li As ListItem

        For Each li In txtCheckBox.Items()
            If li.Selected Then
                strchklist += li.Text + " <br /> "
            End If

        'This is extra code that can be used or deleted for the checkboxlist
        'If strchklist = "" Then
        '    Response.Write("No item Selected")
        '    Response.Write(("You selected : " + strchklist))
        'End If

        '(2) Assign the MailMessage's properties
        mm.Subject = "Website Form: File Management Site New User Request Submitted."
        mm.Body = "<h2>Your Heading for Email</h2> Customer's Name: " & txtName.Text & "<br />Customer's Email: " & txtEmail.Text & "<br />Customer's Comments:" & txtComments.Text & "<br /> Customer's Selections: " & txtCheckBox.SelectedItem.Selected

        mm.IsBodyHtml = True

            '(3) Create the SmtpClient object
            Dim smtp As New Net.Mail.SmtpClient

            '(4) Send the MailMessage (will use the Web.config settings)

            ' show message on screen that email has been sent
            lblMessage.ForeColor = System.Drawing.Color.Green
            lblMessage.Text = "<strong>Email Sent SucessFully</strong><br><hr>"

            ' display error message
        Catch ex As Exception
            lblMessage.ForeColor = System.Drawing.Color.Red
            lblMessage.Text = "There was a problem sending the email, the error is: <br />" & ex.Message & "<br><hr>"
        End Try

    End Sub

End Class

In your webconfig add this under ‘configuration’

             userName="username "

The remote computer that was reached is not the one you specified…

•April 1, 2010 • Leave a Comment

The Error: The connection cannot be completed because the remote computer that was reached is not the one you specified. This could be caused by an outdated entry in the DNS cache. Try using the IP address of the computer instead of the name.

Make sure the time on the target server is accurate. It has to be within 5 minutes of the DC usually or servers and workstations start to act funny, though it should be exact. I corrected the time on my newly reformatted target server (2008 not R2) and immediately connected afterwards from my Win7 PC.

40 years old …

•March 8, 2010 • Leave a Comment

Yep, time to get in shape …  🙂