Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created December 24, 2010 13:55
Show Gist options
  • Select an option

  • Save follesoe/754249 to your computer and use it in GitHub Desktop.

Select an option

Save follesoe/754249 to your computer and use it in GitHub Desktop.
Snippet for the blog post "Free SMS Gadget for Vista using .NET Interop"
// Instance of the GadgetBuilder to load/unload .NET assemblies. See GadgetInterop.js.
var builder = new GadgetBuilder();
// Initialize the adapter to call .NET assemblies.
builder.Initialize();
// Use the builder to add the username and password as constructor argument values.
builder.AddConstructorParam(username);
builder.AddConstructorParam(password);
// Load the Ung1881.dll assembly and create an instance of the Ung1881.Ung1881Client type.
ung1881Client = builder.LoadType(System.Gadget.path + "\\bin\\Ung1881.dll", "Ung1881.Ung1881Client");
//Get values from the UI.
var number = txtPhoneNumber.value;
var message = txtMessage.innerText;
//Sending the message
var status = ung1881Client.SendMessage(number, message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment