This code sample sets up a handler to monitor the c:\ disk for changes in any file’s size, and report those changes to the console. Imports System.IO Module Module1 ”’ <summary> ”’ Display the change events detected by the file system watcher on the console ”’ </summary> ”’ <param name=”sender”></param> ”’ <param name=”e”></param> ”’ <remarks></remarks> […]
Author: bobnoordam
Raising an event on a usercontrol, and subscribing to it from an ASPX page
This is a minimalistic demonstration on hooking into an event risen by a usercontrol. The main page subscribes to the event on the user control, and once the usercontrol raises a postback the event data is retrieved. User control code using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace UsercontrolEvents { […]
Collecting performance data from local and remote systems using C#
Performance data Perfmon is a well known tool to monitor performance data for your local and remote systems. This code snippet gives you a worker class that can be used to connect to local or remote perfmon / system performance data, and provide the resulting information stream to your c# application. Local and remote To […]
Enumerating available performance counters on local and remote systems using C#
Performance counters Perfmon, the well known tool for monitoring performance counters has a nice list of categories and counters for your system. But what if you want to access a counter from code ? Or even worse, want to check if a certain counter is available or not ? In the previous document Collecting performance […]
The absolute minimal jQuery reference
Selectors Used to find elements in your page to do some processing with $(“#menu”) // find the element with the id of menu $(“.someClass”) // find ALL elements with the class someClass $(“h1”) // find All <h1> elements $(“#menu li”) // find all <li> elements in the list with id “menu” Display the value of […]
Creating a threaded windows service
Below is a more or less empty sample from a window service project, you can build in Visual Studio. The service itsself (created by the VS Project) has events for Start and Stop command, which you use to hook your worker code into: Example of an empty worker, which does not do more then writing […]
MVC – Using icons as standard buttons and submit button
The View The following markup defines two images as buttons. Standard GET behevaiour is the simple one of the two, it isnt anything else then an image wrapped into a link. The @Url.Action calls the required action on the controller. The submit button is an actual button. The mini CSS snippet makes sure we dont […]
IIS Redirect to HTTPS and keep your query string
With browsers moving forward with marking all HTTP sites as insecure by default, a lot of sites are now being upgraded to https. If your site is hosted on IIS that is by itsself a simple procedure: Pick the website or virtual directory you want to redirect Click HTTP Redirect in the management console Check […]
DevExpress DateEdit (Date Picker) model binding in MVC
This is the absolute minimum you need to use model binding with the DevExpress date picker control. The important part is that the name setting on the control must be the same as the field name you use to store the picked value in. ViewModel using System; namespace DXWebSample.ViewModels { public class DemoViewModel { public […]
Autosizing screen stops on VmWare Workstation for your linux guest
Sympton:Your display no longer autosizes for your Linux guest, running under VmWare workstation. Cause: This seems to be caused by a race condition where the open-vm-tools try to activate before the graphic environment is available. Resolution: Edit the configuration file for open-vm-tools, by running nano sudo /etc/systemd/system/multi-user.target.wants/open-vm-tools.service And add the following lines in the UNIT […]