Blue Theme Orange Theme Green Theme Red Theme
 
Discover the top 5 tips for understanding .NET Interop
Home | Forums | Videos | Photos | Blogs | Beginners | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
DevExpress UI Controls
Search :       Advanced Search »
Home » » How to remotely load an executable file in ASP.NET

How to remotely load an executable file in ASP.NET

A simple ASP.NET sample to load an executable file (or an application) remotely from internet.

Page Views : 3183
Downloads : 0
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
Discover the top 5 tips for understanding .NET Interop
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

If you want to load an executable file (or an application) remotely, we give a simple ASP.NET with VB.NET program.

----- one button remoteReboot.aspx file -------------

<%@ Page language="vb" Codebehind="remoteReboot.aspx.vb" AutoEventWireup="false" Inherits="Universal.Datatransfer.ExcelOracle.remoteReboot" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<HTML>

 <HEAD>

  <title>remoteReboot</title>

  <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">

  <meta name="CODE_LANGUAGE" Content="VB">

  <meta name="vs_defaultClientScript" content="JavaScript">

  <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">

 </HEAD>

 <body MS_POSITIONING="GridLayout">

  <form id="Form1" method="post" runat="server">

   <asp:Button id="Button1" runat="server"

    Text="Remote Reboot" Width="128px"></asp:Button>

  </form>

 </body>

</HTML>

----- remoteReboot.aspx.vb file -------------

Imports System

Imports System.Collections

Imports System.ComponentModel

Imports System.Data

Imports System.Drawing

Imports System.Web

Imports System.Web.SessionState

Imports System.Web.UI

Imports System.Web.UI.WebControls

Imports System.Web.UI.HtmlControls

Namespace Universal.Datatransfer.ExcelOracle

    '<summary>

    ' Summary description for remoteReboot.

    ' </summary>

 

    Public Class remoteReboot

        Inherits System.Web.UI.Page

        Protected Button1 As System.Web.UI.WebControls.Button

 

        Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

            'Put user code to initialize the page here

        End Sub

#Region "Web Form Designer generated code"

 

        Protected Overrides Sub OnInit(ByVal e As EventArgs)

            ' CODEGEN: This call is required by the ASP.NET Web Form Designer.

            InitializeComponent()

            MyBase.OnInit(e)

        End Sub

 

        Private Sub InitializeComponent()

            AddHandler Me.Button1.Click, AddressOf Me.Button1_Click

            AddHandler Me.Load, AddressOf Me.Page_Load

        End Sub

#End Region

 

        Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

            Dim myProcess1 As System.Diagnostics.Process = New System.Diagnostics.Process

            myProcess1.StartInfo.WorkingDirectory = Request.MapPath("~/bin")

            myProcess1.StartInfo.FileName = Request.MapPath("~/bin/notepad.exe")

            myProcess1.Start()

        End Sub

    End Class

End Namespace 

 

Procedures:

  1. Copy an excecutable file into your web-root bin directory, for example, notepad.exe.

  2. Window XP and Windows Server 2003 have the different settings.

    For Window XP users, edit machine.config file in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG change the userName from Machine into SYSTEM as below,

    <processModel enable="true", ..., userName="SYSTEM" password="AutoGenerate" ... maxIoThreads
    ="20"/>

    For Windows Server 2003 users, you have to set up in a little different way. Just send me an email if you need a help.

  3. If you don't want to application to run under background,  you have to go to \Administrative Tools\Services\IIS Admin and right click Property\Logon, then click the checkbox of Allow service to interact with desktop.

If you don't set (3), your application is still loaded. But it runs under background.

After restart computer, then you can remote load the executable file from the internet.

NOTE: THIS ARTICLE IS CONVERTED FROM C# TO VB.NET USING A CONVERSION TOOL. ORIGINAL ARTICLE CAN BE FOUND ON C# CORNER (http://www.c-sharpcorner.com/).

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Yuan Wang
Yuan is working in an IT firm of Northern VA. He has over 10 years experience in mathematical modeling, parallel computing, and programming. He is currently working with Java, C++ and .NET mostly for modeling, simulation, and web application development with SQL Server and Oracle. In his past life, Yuan's Ph.D research was focused on Applied Probabilistic Models, Operations Research and Parellel Computing.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the top 5 tips for understanding .NET
Ricky Leeks presents the top 5 tips for understanding .NET Interoperability. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Team Foundation Server Hosting
Become a Sponsor
 Comments
6 Months Free & No Setup Fees ASP.NET Hosting!
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.