.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani
Post New Web Links

Pass Command to Running Program?

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :Windows Application
 

I have a Windows Form app written in C# and I would like a way to close the app from the command line without killing it.

Is there a recommended way to do this gracefully?

Perhaps I can pass a command to the running app to tell it to shutdown?

Thanks!

 

 




View Complete Post


More Related Resource Links

How can I have my program access another program that is running on the same computer?

  
We use 5 different applications at work. There is a lot of copying and pasting and going back and forth between applications. It can be very draining. The main program that I want to interface with is a ticketing application. It was not designed to be manipulated by another program, only a person. One way would be to write a program which moves the mouse around and types things into the fields and navigates between the different windows. But the problem with that is the user (me) would not have the screen/mouse/keyboard free while this was happening as the program would be using it. How would you go about just getting the data straight from memory? If that is not an option could I move the program off screen and manipulate it there? I don't know what language the program was written in. Maybe I could decompile it? Is there a good way to monitor the information it sends across the network? If so I could just have my program make the same requests and then completely bypass the current program.   Do you have any ideas?

How do I obfuscate .Net IL code using command line program?

  
How do I obfuscate .Net IL code using command line program? I want free tool that can be deployed to obfuscate DLL generated from compiled tool?

Sql Command running into exception pls help as its urgent

  
SqlCommand MyCommand1 = new SqlCommand("Insert into incoming_inventory(division_code,inv_date)  select '"+dd_district.SelectedValue+"','+'" + DropDownList3.SelectedValue + "'+'/'+dayno+'/'+'2010' from month_day where month_name=datename(month,dateadd(month," + DropDownList3.SelectedValue +",0)-1)'", MyConnection1);                     

When i start a process and running an external program is there any way to set the program window po

  

  private void View_Log_File_Click(object sender, EventArgs e)
        {

            if (processNotePad == null || processNotePad.HasExited)
            {
                processNotePad = System.Diagnostics.Process.Start("notepad.exe", "\"" + path_exe + "\\log\\logger.txt\"");
            }
            else
            {
               
            }

           
           
        }

The problem is after the program the process started and i see the program when i click somewhere on the form1 the main application window the window of the process program is moving

incorporate/ migrate c# command line program into asp.net aspx web app - urgent

  

hi,

i am facing an urgent problem with my current project.

so far, i have a stand-alone c# console appplication project that used a thirdparty pdf-library to genereate a pdf file with some text.

my problem now is that i don't know how to incorporate/ or rather migrate this into aspx web app. 

ie. what i want is to have the website display either the pdf file or display the text/ content of the pdf file dinamically.

please provide me some hint/ sample code if possible.

thanks


How to pass SQL server 2005 instance name as a input parameter to restoressp STSADM command

  

I am facing a problem with restoressp STSADM command. We are using a separate SQL server 2005 instance for our SharePoint PORTAL. For e.g. the instance name is MOSSSQL. I have restored the SSP database from production environment to development environment. But facing the problem when I associate the restored SSP database with new SSP using restoressp STSADM command.


As per Microsoft guideline I have used the restorespp command to attach the database with my new SSP. If I pass the sspdatabaseserver input parameter as “servername\SQL instance name” then its giving me the error message that “required argument are mission – sspdatabase”.

Below is the command

stsadm -o restoressp   
-title “My-SSP"
-url "http://mymoss:11111/"
-ssplogin "username"
-mysiteurl "http://mymoss/mysites/"
-indexserver "MYMOSS"
-indexlocation "e:\logs\"
-sspdatabaseserver "MYMOSS\MOSSSQL "
-sspdatabasename "MySSP1_SSP"
-ssppassword "password"
-searchdatabaseserver "MYMOSS\MOSSSQL"
-searchdatabasename "MySSP1_Search"
-ssl no

Note: I have system admin rights and I am the DB owner

 

 


Senthilrajan K

Running SSIS package from Stored Procedure using dtexec and Pass boolean value

  

Hi,

We are using SSIS 2005 and sql server 2005. My package has a boolean type package level variable. Eg: IsClientNull boolean type.

I call this package from stored procedure. In addition to passing values for other parameters, how can I pass boolean value.

My code is like this:

SET @CMD='dtexec ' +
'/FILE ' + @pShareName + @pPackageName + ' ' +
'/MAXCONCURRENT " -1 " ' +
'/CHECKPOINTING OFF ' +
'/REPORTING EW ' +
'/SET "\Package.Variables[User::StartDate].Properties[Value]";' +
CONVERT(char(10), @pStartDate, 120) + ' ' +
'/SET "\Package.Variables[User::EndDate].Properties[Value]";' +
CONVERT(char(10), @pEndDate, 120)
IF (@pClient IS NULL)
BEGIN

 SET @CMD = @CMD + ' ' +
 '/SET "\Package.Variables[User::IsClientNull].Properties[Value]";' +
 'True%


Cannot execute a program. The command being executed was "c:\WINDOWS\Microsoft.NET\Framework\v3.5\cs

  

The webserive is throwing the following exception every time unless I reset iis. I don't think it is machine dependent as it is happening on other machines. There is some fix for asian version and I don't think I have asian version (conime). but I tried it anyway but doesn't work. The error clears by restarting IIS on development but that is not a solution for webserver. Does anybody know how to resolve this issue? It's not memory issue as I have plenty of free memory.

ExternalException (0x10b): Cannot execute a program. The command being executed was "c:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" /noconfig /fullpaths @"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\fi_firtkservice\5e540d70\ff1820cc\nitishj0.cmdline".]
   System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +2204
   System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +122
   Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDi

How to pass perameters in exec command when we using XML in stored Procedure?

  

My SP is:

USE [PrintLableTest]

GO
SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER OFF

GO
CREATE
PROC [dbo].[sp_Insert_Table_PrintLabelTB1XML]

@pData varchar (1000)

AS

--BEGIN TRY

BEGIN

DECLARE @Doc INT

DECLARE @CPART nvarchar(50)

DECLARE @ItemNo nvarchar(50)

DECLARE @TPART nvarchar(50)

DECLARE @Code nvarchar(50)

DECLARE @BarCode nvarchar(50)

DECLA

Can I pass a SqlParameterCollection object into a SQL Command

  
I currently have a connection class that handles all of my database connectivity. What I am trying to do is build a SqlParameterCollection object on one page, then pass that object to my connection class. Is it possible to do this? I am not getting any compilation errors, but I can not get the parameters to be recognized. Here is what I am trying to do: Page 1: string sql = null; conn.strConn = connectionstring; sql = "sqlstring"; SqlParameterCollection newcollect = null; newcollect.Add("@Switch",1); conn.OpenReader(sql, newcollect); while (conn.DR.Read()) { read data onto page here... } conn.CloseReader(); Page 2 (connection class) : public void OpenReader(string sql, SqlParameterCollection collect) { Conn = new SqlConnection(strConn); Conn.Open(); Command = new SqlCommand(sql,Conn); Command.Parameters.Add(collect); <------This is the root of my question Command.CommandTimeout = 300; // executes sql and fills data reader with data DR = Command.ExecuteReader(); } Can you do this??? And if so, can anyone tell me why the statement will not return any data? The procedure works perfectly, and will work if I use the standard way of passing the parameters to the command statement.

Running a program once every day uisng ASP.NET - job scheduling.

  

I have developed a workflow web based program using ASP.NET with VS 2005. The process is about renew the Medical Card for exiting employess and/or issue new Medical Cards for new Employess.

The user simply fills a PDF From (to complete his part of the work) and submits the form to the next user in the workflow process.

There are 3 levels in the workflow process:

1. Initiate Form by Staff,

2. Submit for Apprval from HR,

3. Submit for Approval from the Health Department.

4. Print the Medical Card.

The program is now near 90% completed. It sends email to target users asking them to complete their part of the process such as "Approve", "Reject" or "Submit for Approval", "Print Card" ... etc.

Mind you that I am not using WCF, I mean, I am not using the .NET Workflow Features. I am implementing the workflow and email notification using traditional programming.

I was requested to add a new feature to send Auto Notifications as follows:

1. If the users receives the form and he does not complete his part within 3 days, then it will send a reminder to the user.

2. Send a reminder to the staff that the Medical Card will be expired before one month of the "Valid Until".

I can do that by developing a program or a VB.NET function called "WorkflowScheduledJob()" which will loop

How to Pass Values Between Web Pages ASP.NET

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

Program for Format Conversion of An Image

  
.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Show grand total running total in GridView Footer

  
In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

Row command working on all rows not selected one?

  

Hi,

I have this code that hides a column in a gridview.  (The column houses another nested gridview).


    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "Select" Then
            If GridView1.Columns(0).Visible = False Then
                GridView1.Columns(0).Visible = True
            Else
                GridView1.Columns(0).Visible = False
            End If
        End If
    End Sub


The trouble is that if I click the select link on one row that action to hide is carried out on all rows.  How can I set this up so that it only hides the row that is selected?


Thanks.


pass value from textbox to action, formcollection best way here?

  

Hi I'm building a e-commerce store and on quantity of product I'm going with a textbox. I thought I would ask how would you do this? a viewmodel to use a strongly typed textbox or just get the value of the textbox from the formscollection passed in to the action?


Thanks for any input


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend