Welcome to BlogEngine.NET 1.6.0

23. January 2010

If you see this post it means that BlogEngine.NET 1.6.0 is running and the hard part of creating your own blog is done. There is only a few things left to do.

Write Permissions

To be able to log in to the blog and writing posts, you need to enable write permissions on the App_Data folder. If you’re blog is hosted at a hosting provider, you can either log into your account’s admin page or call the support. You need write permissions on the App_Data folder because all posts, comments, and blog attachments are saved as XML files and placed in the App_Data folder. 

If you wish to use a database to to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.  If you are interested in using Microsoft SQL Server, MySQL, VistaDB, or other databases, please see the BlogEngine wiki to get started.

Security

When you've got write permissions to the App_Data folder, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change the username and password.  Passwords are hashed by default so if you lose your password, please see the BlogEngine wiki for information on recovery.

Configuration and Profile

Now that you have your blog secured, take a look through the settings and give your new blog a title.  BlogEngine.NET 1.4 is set up to take full advantage of of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.  Be sure to fill in your author profile to take better advantage of this.

Themes and Widgets

One last thing to consider is customizing the look of your blog.  We have a few themes available right out of the box including two fully setup to use our new widget framework.  The widget framework allows drop and drag placement on your side bar as well as editing and configuration right in the widget while you are logged in.  Be sure to check out our home page for more theme choices and downloadable widgets to add to your blog.

On the web

You can find BlogEngine.NET on the official website. Here you'll find tutorials, documentation, tips and tricks and much more. The ongoing development of BlogEngine.NET can be followed at CodePlex where the daily builds will be published for anyone to download.

Good luck and happy writing.

The BlogEngine.NET team

,

Visual Studio 2010 Beta 2 Needs Work

16. January 2010

I’ve been trying to use nothing but Visual Studio 2010 for my at-home development uses. For the most part it works decently until it decides to be not be so cordial. I’ve seen things from group boxes all of a sudden only half the text on any contained controls displays. Restarting Visual Studio does nothing to redisplay the text even though it’s clearly in the Text property window. The only solution to that seems to be to add or change one character on any of the contained controls and auto-magically the rest of the text in all the controls displays properly again within the group box. That one has happened several times already.

There has also been the fancy quirks of leaving Visual Studio 2010 running and using it through a remote desktop connection. That one causes some strange behavior from getting stuck in a frozen state, not releasing locks to referenced assemblies, which that assembly part sucks when said assemblies solution is open in another Visual Studio instance you want to compile. That may have just been something weird between Visual Studio 2010 as the main windows form project and Visual Studio 2005 as the assembly project. The worst being when switching between code pages where the code-behind looses the cursor. Just stops showing up, don’t know where you are, but it can still move and select text using the mouse or keyboard. Just the funny thing is the text doesn’t show itself being selected either, but you can definitely ctrl-c it and it copies find to the clipboard.

Who knows, but the oddities are adding up quickly. I just had Visual Studio 2010 crash for the third time for unknown reasons as a result of adding an About Form to the project and modifying the About Form’s form wide text. Open the project, close all code behind, open the About Form, right-click to view code, and then it prompts to restart itself. I think that means go to bed and shut down for the night.

Programming, .Net

DataGridView Drag and Drop with Multiple Files

13. January 2010

I was working on a project tonight and I noticed something kind of odd. There are a ton of references out there for how to handle the DragDrop event with a single file, but I wasn’t able to find really anything about handling multiple files. Needless to say I figured I’d make a post to remedy this problem.

First thing to note is to select the DataGridView in the designer and from the properties window set “Allow Drop” to “True" to enable the events. Second is to add an event handler to the DataGridView DragEnter event. Within the event simply set e.Effect to one of the desired DragDropEffects enumeration values as such:

private void dgvImageFiles_DragEnter(object sender, DragEventArgs e)
{
     e.Effect = DragDropEffects.Copy;
}

The next step is to simply add an event handler for the DragDrop event and use e.Data.GetData(“FileDrop”) to get a string array containing the full file paths to each file dropped into the DataGridView control. That was at least my desire when building this code, but you could just as easily handle any of the other data format values available from e.Data.GetFormats() function. Below is the DragDrop event I’ve used to get the files dropped into the DataGridView control:

        private void dgvImageFiles_DragDrop(object sender, DragEventArgs e)
        {            
            if (e.Data.GetDataPresent("FileDrop"))
            {
                string[] files = (e.Data.GetData("FileDrop") as string[]);
 
                foreach (string file in files)
                {
                    . . . 
                }
            }
        }

That is how to handle drag and drop with the DataGridView with multiple files. Easy enough eh? Well then back to programming I go.

.Net, Programming

Logitech Mouse Kicked the Bucket

10. January 2010

I can’t help but miss my Microsoft Intelimouse Explorer more and more. I bought a replacement Logitech mouse model M-BZ105A and the thing didn’t even last a full year. It’s been a huge disappointment as the mouse wheel caused a blister on my pointing finger, the wheel is difficult to get pressed directly down and often goes either left or right. Tonight the mouse acted as if moving the mouse was stuck unable to move left or right and finally just stopped responding. It’s the only mouse Logitech made that fits my hands even close to what the Intelimouse did. I can’t help but feel a bit cheated after spending sixty dollars on a device that can’t last even a year compared to the ten years of solid use my Intelimouse endured.

Thankfully I found that of all places NewEgg.com actually sells an older style Microsoft Intelimouse Explorer! I’m thrilled I hope to goodness it holds up to the standards of the last one. I just placed the order and am anxiously awaiting the new mouse. I really should have just bought another Magic Mouse and hooked it to Windows, but gaming would be difficult to adjust to the touch surface of the Magic Mouse.

Computer Hardware

Blog Engine Spam Cleanup Utility

9. January 2010

While this is totally a reactive approach to dealing with the spam bots posting comments I thought I’d share the clean-up project. In the end I have to give the bots credit for being so kind in nature of appreciative comments. It’s easy to get a big head reading the comments even though they are clearly bots with scripted content.

Attached is the project along with the XML block list. The block list is not complete with equal email, author, IP, and website listing for all the comment postings I received. It was sufficient enough for my needs to clean the comments up. The list may vary depending on the different bots that have visited the blog site, but should allow anyone in the same situation to clean up the mess. The code is roughly written and meant for a one-off cleanup, but below is the code along with the full project that includes the XML block list.

Blog Comment Cleaner Utility

Please note the project was created with Visual Studio 2010 beta 2 in case of difficulty opening the solution file.

Example Command Line:

BlogCommentCleaner.exe “c:\blog\App_Data\posts” “c:\blog\App_Data\block.xml”

Programming, Programs & Utilities, .Net

Blog Engine Spam Cleanup

7. January 2010

After reviewing my web logs I’ve noticed a big uptick in the number of external links to spam sites. I knew about the spam bots posting tens of hundreds of comments on this blog and I promptly shut down comment postings. The bad thing is I authorized all of them to appear not realizing I had set comments to being moderated, and promptly forgot to authorize any comments. That’s why nobody ever saw or heard from me in reply to legit comment postings. ~Sorry~

I took it upon myself to write a blog engine comment spam cleanup utility. It’s basically a console application that just runs through the XML postings (not database driven) using LINQ to XML to query comments looking for criteria on Author, Email, IP, and Website. These elements exist within the posting files within the comment element, and was core to the filtering process.

Essentially I just created a new XML filter file called ‘blocked.xml’ that I created using the following structure:

   1:  <block>
   2:      <emails>
   3:          <email>...</email>
   4:      </emails>
   5:      <authors>
   6:          <author>...</author>
   7:      </authors>
   8:      <ips>
   9:          <ip>...</ip>
  10:      </ips>
  11:      <websites>
  12:          <website>...</website>
  13:      </websites>
  14:  </block>

From there I load each section into a generic list, using LINQ, and loop through creating a new XDocument for each posting file looking for the comments element’s child comment elements. It queries each comment section in each post looking for any comment that contains emails/ips/author/ or websites contained in the generic lists created from the block list file. Upon finding an offending element it removes its parent element, being the comment element, and removes it from the comments element. Thus removing forever the spam that currently exists from all posting files based on the block list.

The problem is building out the block list. Don’t want to arbitrarily remove valid comments. Luckily most of the spam bots that have taken root on the block share many of the some websites even though email addresses are often random for the same bots. I’m still building out my block list and at this point only have a hundred or so blocked elements added. I will need to most likely script out the creation of the block list so I don’t have to manually build the list. Still so far after manually building the list for an hour it’s dropped the existing spam count by a quarter of what it used to be. Not finished, but it’s getting there.

All of this work brought out an interesting fact that there is no option to remove all comments from view in the blog comment settings, which would have been nice to reduce external linking to websites with T & A related content. You’d think since it can enable and disable allowing comments there would equally be a show/hide all comments setting for those not looking to ever allow comments. Probably pretty niche, but still would be nice for just such an spam infestation occasion.

Programming, Programs & Utilities