Skip to main content

Posts

Showing posts from June, 2010

.NET MONO Which Operating System is Running?

Do you want to execute operating system specific code (exes) in the .NET/Mono framework? I’ll go over how you can do that. Below is part of a class I had written that can determine if Linux or Windows is running. Keep in mind that for the code to properly detect Mac OS, you will need to figure out the proper platform number and modify the code respectively. using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; namespace namespace1 { public static class HostOS { /// <summary> /// An enumerator that holds a list of possible operating systems /// this code can execute on. /// </summary> public enum HostEnvironment { Windows, Linux } /// <summary> /// Determine the operating system this program is running on. /// </summary> /// <returns>The current operating system</returns> /// <rem...

Wordpress Visual Editor CRLF Quirk

Adding extra vertical space (eg. carriage return) to postings in WordPress can be a pain. While there might be a plugin to fix the issue, learned by searching around that using the code: <br class="blank" /> When in HTML mode will not be deleted by the visual mode processor. So if you flip back and forth between the two input modes, that code appears to be safe from being removed.