Skip to main content

Mark Wagner - Cogitation Blog

Go Search
Blog
SPDev
SharePoint
Governance
  

Mark Wagner - Cogitation Blog > Categories
MSDN Download Manager keeps suspending?

Jason Bunting has a cool little trick to keep it running here.  Sometimes the obvious - is just not obvious enough.  Good job Jason.

Send Email Link for IE

I try not to have any (OK, many) obsessions; however, one is my consumption for information.  Because of this I have to strictly monitor myself from deviating from my present task.  I am sometimes easily distracted.

To help me remember about “something I found interesting“, I have a nice little custom link button labeled “Send” that I use in my Internet Explorer browser to quickly send myself an email.  The email contains a subject and the link to the website in the body.  Yes, you can do this by clicking, File > Send > Link by E-Mail, but this is to many clicks for me.  Yes, I am impatient and have to work on this also.

This works with one click - much better.  Your Links toolbar needs to be turned on to easily access the buttons in IE.  I have my located immediately after the Address bar as shown here.

 sendbutton

Simply paste the the following javascript code into the URL of the link properties.

javascript:navigate('mailto:YOUR-EMAIL@HERE.COM?subject=LINK:%20'+escape(document.title)+'&BODY='+escape(location.href))

The only thing you need to customize is the YOUR-EMAIL@HERE.COM portion.  Here is a sample of the properties dialog.

To create a link button you can drag the “e“ icon in the address bar to the Link toolbar.  To get the properties, right-mouse-click on a link you want to edit.  Here is a sample of the properties dialog.

  sendbuttonprops

Warning: For me these emails are subtle “tasks” to learn more.  Your inbox may quickly fill up. :)

Simple String Date Validation

Simple string date validation.

Updated: Use DateTime.TryParse() method instead (which was introduced after this original posting which was originally posted during the .NET version 1.x days and moved from my old blog)

Example:

  DateTime testDate;
  bool isValidString = DateTime.TryParse(myDateString, out testDate);

Original (Obsolete) Posting during .NET 1.0:
I am a big fan of maintaining a library of simple and clean helper methods.  Here is a simple and clean way to verify if a string formatted date is a valid date.  This allows you to encapsulate the exception handling making it easy to use and very readable - another important coding practice.

private static bool IsDate(string sDate)
{
    DateTime dt;
    bool isDate = true;

    try
    {
        dt = DateTime.Parse(sDate);
    }
    catch
    {
        isDate = false;
    }

    return isDate;
}