ProcessStartInfo没有调用WinForm EXE

时间:2014-01-31 18:33:41

标签: c# asp.net winforms exe

当我在localhost中运行我的应用程序时,它会触发EXE。我将Web应用程序加载到IIS 6中,它驻留在真实服务器上,我得到的只是网页,但Winform EXE永远不会被执行或启动。我在下面的代码中遗漏了什么?

Winform代码:

    //SQL section for returning images
    #region "Images Query"

    ImageQuery = "SELECT isn AS isn ";
    ImageQuery += "FROM bc_bcc_document (NOLOCK) ";
    ImageQuery += "WHERE barcode_id = ? ";

    DataTable Imagetable = new DataTable();
    Imagetable.Columns.Add("ISN", typeof(Int32));
    DataRow Imagerows;

    //fills table with Images information
    OdbcCommand comd = new OdbcCommand(ImageQuery);

    string conne = "Dsn=XXXX; uid=XXXXX; pwd=XXXXXX";

    using (OdbcConnection connected = new OdbcConnection(conne))
    {
        comd.Connection = connected;
        connected.Open();

        comd.Parameters.AddWithValue("barcode_id", txtBarcode.Text);

        OdbcDataReader readar = comd.ExecuteReader();

        while (readar.Read())
        {
            isn = Convert.ToInt32(readar["isn"].ToString().TrimEnd());
            Imagerows = Imagetable.NewRow();
            Imagerows["ISN"] = isn;
        }
        readar.Close();

网络应用代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;

namespace ImageView2
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var proc = new Process
            {
                EnableRaisingEvents = false,
                StartInfo = new ProcessStartInfo()
                {
                    UseShellExecute = false,
                    FileName = @"C:\ImageViewer\ImageView.exe",
                    Arguments = Request.QueryString["DKT_ID"].ToString()
                }
            };
            proc.Start();
        }
    }
}

0 个答案:

没有答案