How to increase a VHD file

The total size a VHD file is determined at the time you create it. If you want to increase the total size of the VHD file, you would have to do it just like with any real hard drive, first increase the size of the partition and then expand it.

  • First use VHD Resizer to increase the file.
  • Then map the new VHD as a second hard drive to the old vm.
  • The last, go to DOS command.

    diskpart
    list disk
    select disk=1
    list partition
    select partition =1
    extend

Simple Event Sample


Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in D:\InetPub\vhosts\kwu-1639.package\kennywu.info\wwwroot\wp-content\plugins\wp-syntax\wp-syntax.php on line 380
using System;
 
namespace EventSample {
    class Program {
        static void Main(string[] args) {
            Metronome m = new Metronome();
            Listener l = new Listener();
            l.Subscribe(m);
            m.Start();
        }
    }
    public class Metronome {        
        public event EventHandler<EventArgs> OnTick;
        public EventArgs e = null;                
        public void Start() {
            while (true) {
                System.Threading.Thread.Sleep(3000);
                if (OnTick != null) {
                    OnTick(this, e);                    
                }
            }
        }
    }
    public class Listener {
        public void Subscribe(Metronome m) {            
            m.OnTick += HeardIt;
        }
        private void HeardIt(object sender, EventArgs e) {
            System.Console.WriteLine("HEARD IT");
        }
    }
}