My code is
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.InteropServices.Automation;
namespace ClientTest
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}
private void btnInstall_Click(object sender, RoutedEventArgs e)
{
if (Application.Current.InstallState == InstallState.NotInstalled)
Application.Current.Install();
}
private void txtOpenProgram_Click(object sender, RoutedEventArgs e)
{
using (dynamic shell = AutomationFactory.CreateObject("WScript.Shell"))
{
shell.Run(@"C:\Program Files\Notepad++\notepad++.exe");
shell.SendKeys(txtTextToSend.Text);
}
}
}
I am using VS 2010, Silverlight 4 and .NET 4

New Topic/Question
Reply



MultiQuote




|