Created
December 24, 2010 13:55
-
-
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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