English 中文(简体)
防止指挥窗口显示,有色人种公司将窗户编成申请
原标题:Prevent command window showing when NAnt compiling windows forms application
  • 时间:2010-04-01 21:40:59
  •  标签:
  • c#
  • nant
  • csc

我一直在玩.,在没有视觉演播室的情况下制作很少的窗户。

我在附注pad++中创建了我的消息来源,并编集了一台NAnt建筑材料。

当我管理申请时,还展示了指挥窗口以及应用窗口。 我怎么能防止指挥窗口的出现?

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Media;
using System.IO;

namespace mynamespace
{
    class MyForm : Form
    {   
        public Button btnPlay;

        MyForm()
        {
            this.SuspendLayout();

            this.Text = "My Application";

            InitialiseForm();       

            this.ResumeLayout(false);
        }

        private void InitialiseForm()
        {
            btnPlay = new Button();
            btnPlay.Location = new System.Drawing.Point(30,40);
            btnPlay.Text = "Play";
            btnPlay.Click += new System.EventHandler(btnPlay_Click);

            this.Controls.Add(btnPlay);
        }

        protected void btnPlay_Click(object sender, EventArgs e)
        {
            string wav = "testing123.wav";
            Stream resourceStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(wav);
            SoundPlayer player = new SoundPlayer(resourceStream);
            player.Play();  
        }

        public static void Main()
        {
            Application.Run(new MyForm());
        }
    }   
}

1. 建立档案

<?xml version="1.0"?>
<project name="myform" default="build" basedir=".">
    <description>My Form app</description>
    <property name="debug" value="true" overwrite="false"/>
    <target name="clean" description="Remove all generated files">
        <delete dir="build"/>
    </target>
    <target name="build" description="Compile the source" depends="clean">
        <mkdir dir="build"/>
        <csc target="exe" output="buildMyForm.exe" debug="${debug}" verbose="true">
            <resources>
                <include name="app
esources*.wav" />
            </resources>
            <sources>
                <include name="appMyForm.cs"/>
            </sources>
        </csc>
    </target>
</project>
问题回答

我知道,我需要具体说明目标=“双赢”而不是目标=“exe”。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签