Click here to Skip to main content
15,916,378 members
Home / Discussions / C#
   

C#

 
AnswerRe: Idiotic Notepad/C#/Command Prompt Questions Pin
mav.northwind21-May-06 2:39
mav.northwind21-May-06 2:39 
QuestionButtonColumn Pin
drc_no120-May-06 8:20
drc_no120-May-06 8:20 
AnswerRe: ButtonColumn Pin
OmegaCD20-May-06 13:32
OmegaCD20-May-06 13:32 
Questionsystem commands?? Pin
kago51220-May-06 8:16
kago51220-May-06 8:16 
AnswerRe: system commands?? Pin
Rei Miyasaka20-May-06 8:50
Rei Miyasaka20-May-06 8:50 
AnswerRe: system commands?? Pin
David Stone20-May-06 8:53
sitebuilderDavid Stone20-May-06 8:53 
GeneralRe: system commands?? Pin
kago51220-May-06 10:51
kago51220-May-06 10:51 
AnswerRe: system commands?? Pin
kago51221-May-06 3:35
kago51221-May-06 3:35 
Ok I finally Got this to work

Here is the code I used:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

Process p = new Process();
StreamWriter sw;
StreamReader sr;
StreamReader err;



ProcessStartInfo psI = new ProcessStartInfo("cmd");
psI.UseShellExecute = false;
psI.RedirectStandardInput = true;
psI.RedirectStandardOutput = true;
psI.RedirectStandardError = true;
psI.CreateNoWindow = true;
p.StartInfo = psI;


p.Start();
sw = p.StandardInput;
sr = p.StandardOutput;
err = p.StandardError;



sw.AutoFlush = true;

sw.WriteLine("nbtstat -A " +textBox1.Text);


sw.Close();

textBox2.Text = sr.ReadToEnd();
textBox2.Text += err.ReadToEnd();


Questionwhat is wrong in this code Pin
mm31020-May-06 7:03
mm31020-May-06 7:03 
AnswerRe: what is wrong in this code Pin
leppie20-May-06 7:07
leppie20-May-06 7:07 
AnswerRe: what is wrong in this code Pin
Rei Miyasaka20-May-06 8:54
Rei Miyasaka20-May-06 8:54 
AnswerRe: what is wrong in this code Pin
turbochimp21-May-06 20:25
turbochimp21-May-06 20:25 
Questionget device context size Pin
thepersonof20-May-06 6:44
thepersonof20-May-06 6:44 
AnswerRe: get device context size Pin
leppie20-May-06 7:17
leppie20-May-06 7:17 
Questiontwain or isis Pin
cmarmr20-May-06 5:45
cmarmr20-May-06 5:45 
AnswerRe: twain or isis Pin
OmegaCD20-May-06 13:35
OmegaCD20-May-06 13:35 
QuestionGUI API wrapper? Pin
Jonas Beckeman20-May-06 4:59
Jonas Beckeman20-May-06 4:59 
AnswerRe: GUI API wrapper? Pin
Rei Miyasaka20-May-06 8:53
Rei Miyasaka20-May-06 8:53 
GeneralRe: GUI API wrapper? Pin
Jonas Beckeman20-May-06 13:43
Jonas Beckeman20-May-06 13:43 
QuestionQuestion by TreeList Pin
Dima Filipiuk20-May-06 3:41
Dima Filipiuk20-May-06 3:41 
AnswerRe: Question by TreeList Pin
NaNg1524120-May-06 7:21
NaNg1524120-May-06 7:21 
GeneralRe: Question by TreeList [modifed] Pin
Dima Filipiuk20-May-06 8:09
Dima Filipiuk20-May-06 8:09 
GeneralRe: Question by TreeList Pin
Dima Filipiuk20-May-06 9:33
Dima Filipiuk20-May-06 9:33 
QuestionDateTime Pin
| Muhammad Waqas Butt |20-May-06 2:17
professional| Muhammad Waqas Butt |20-May-06 2:17 
AnswerRe: DateTime Pin
Talal Sultan20-May-06 2:34
Talal Sultan20-May-06 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.