Category Archives: C#.Net

C# Reflection Code to Search Objects for Fields Properties and Methods and Get Values

2016-07-06 Code below will search for a given named property, field, or method inside a given object. It will search in below order: Properties Fields Methods It will continue to search until it finds a match that holds or returns (for methods) … Continue reading

Posted in C#.Net | Tagged , , , , , , , , , , , , , | Leave a comment

C# extension method to check if a string matches any string in given list

2016-06-16

Posted in C#.Net | Tagged , , , , , | Leave a comment

Preserving milliseconds when passing dates around front end

2016-06-08 Instead of passing the datetime pass the datetime.Ticks which is a (long) numeric value so the complete datetime value will be preserved. Then convert ticks back to datetime in the server (controller \ action method).

Posted in ASP.Net, ASP.NET MVC, C#.Net, Web Development | Tagged , , , | Leave a comment

Always on top web browser

9-9-2015 Today I wanted to watch an online video while working on other windows but couldn’t get my browser to do it. After failing with recommended solutions such as browser extensions I thought to quickly bring together a little browser … Continue reading

Posted in C#.Net, Products | Leave a comment

Stop asp.net from encoding the source HTML string (mvc raw html)

/// Stops asp.net from encoding the source HTML string. public static IHtmlString HTMLRaw(string source) { return new HtmlString(source); } call this function whenever you want asp.net NOT to encode the string. Note: You can use <%= and %> tags to … Continue reading

Posted in ASP.Net, C#.Net, Microsoft .Net Framework | Tagged | Leave a comment

How to Add/Update/Remove Application Configuration (App.Config) Keys

14/05/2013 How to add new keys to app.config file? Simple, just use this code. When you execute this code, a new key will be added to your configuration file and the given value will be set for it. Important: This … Continue reading

Posted in C#.Net, Microsoft .Net Framework | Tagged , , , , , , | Leave a comment

ILT – How to bring your window (form) to the top C#

2013/04/11 How to bring a window (form) to the top? Or how to make your window active from the code? Simply: call the Activate() function (method) of your form instance. Menol ILT

Posted in C#.Net | Tagged , , , , , , | Leave a comment

ILT – Command to lock a windows computer

19/03/2013 How to program your custom keyboard key to lock your computer? How to programmatically lock your computer? How to lock your computer from the run dialog box? How to lock your computer form DOS? Answer: Just use following command … Continue reading

Posted in C#.Net, General Computing | Tagged , , , , , , | Leave a comment

ILT – How to Programmatically Get Version Information of a Visual Studio Solution

03-10-2012 How to get major, minor, build and revision version figures for a visual studio solution (using c#)? Menol ILT    

Posted in C#.Net | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

ILT – Click-Once Deployment Error – Cannot Publish Because a Project Failed to Build

28-08-2012 Deploying using click-once setup is very easy. If you need a step by step guide to deploy a click-once, I’d recommend this article. Even though it is easy to create a click-once deployment package, the visual studio can face … Continue reading

Posted in C#.Net | Tagged , , , , , , , , | Leave a comment