Click here to Skip to main content
15,914,413 members
Home / Discussions / C#
   

C#

 
AnswerRe: Design display problem in c# Pin
Gareth H8-May-08 22:50
Gareth H8-May-08 22:50 
QuestionHow to set search provider to my browser in c#.net ? Pin
Thirukkumaran8-May-08 21:50
Thirukkumaran8-May-08 21:50 
AnswerRe: How to set search provider to my browser in c#.net ? Pin
Vikram A Punathambekar8-May-08 22:25
Vikram A Punathambekar8-May-08 22:25 
QuestionRemoting Exception...Am i solving it correct.......? Pin
Siddharth Rastogi8-May-08 21:03
Siddharth Rastogi8-May-08 21:03 
AnswerRe: ASP.NET Question Pin
Gareth H8-May-08 22:48
Gareth H8-May-08 22:48 
GeneralRe: ASP.NET Question Pin
Siddharth Rastogi8-May-08 22:53
Siddharth Rastogi8-May-08 22:53 
QuestionCrystal report viewer toolbar Print button event PinPopular
AbhijeetB8-May-08 21:01
AbhijeetB8-May-08 21:01 
Questioncan anyone help me out? Pin
cristi_alonso8-May-08 20:54
cristi_alonso8-May-08 20:54 
I am trying to generate mof file from mib file by calling cmd.exe from my .net application and then executing a command from CMD.exe for genearting mof file .please go through the following code
-----------------------------------------------
////sample code///
using System;

using System.Collections.Generic;

using System.Text;

using System.Diagnostics;

using System.ComponentModel;
using System.IO;

namespace Console_sample

{

class Program

{

public void OpenWithArguments()

{
string dir = @"C:\WINDOWS\system32\wbem\snmp";

//Set the current directory.
Directory.SetCurrentDirectory( dir );

ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe");

Process p = new Process();

startInfo.RedirectStandardInput = true;

startInfo.UseShellExecute = false;

startInfo.RedirectStandardOutput = true;

startInfo.RedirectStandardError = true;

p = Process.Start(startInfo);

p.StandardInput.WriteLine(@"Echo on");

p.StandardInput.WriteLine(@"smi2smir /a RFC1213-MIB.mib ");


p.StandardInput.WriteLine(@"mofcomp RFC1213-MIB.mof ");


p.StandardInput.WriteLine(@"EXIT");

string output = p.StandardOutput.ReadToEnd();

string error = p.StandardError.ReadToEnd();

p.WaitForExit();

Console.Write(output);

p.Close();

Console.Read();

}

static void Main(string[] args)

{

Program myProcess = new Program();

myProcess.OpenWithArguments();


}

}

}
////code ends///
-------------------------------------------------
In this code the line p.StandardInput.WriteLine(@"smi2smir /a RFC1213-MIB.mib "); is not getting excuted .when i run this command smi2smir /a RFC1213-MIB.mib in command prompt it's getting excuted .even the next line of code is working fine .

can anyone tell how to fix this problem?Actually i am looking for WMI COM API for generating mof file from mib file but i didn't get it so i am trying to do it by another way .if anyone can give me API for following command in C# .net it will be very helpfull.

any help appreciated
Thanks in advance
QuestionReportViewer Pin
_str_618-May-08 19:55
_str_618-May-08 19:55 
QuestionDom Inspector assistance [modified] Pin
binaryDigit@@8-May-08 18:25
binaryDigit@@8-May-08 18:25 
AnswerRe: Dom Inspector assistance Pin
binaryDigit@@9-May-08 7:49
binaryDigit@@9-May-08 7:49 
Questionis this coding correct? Pin
Thomas Toh8-May-08 17:00
Thomas Toh8-May-08 17:00 
AnswerRe: is this coding correct? PinPopular
Christian Graus8-May-08 17:14
protectorChristian Graus8-May-08 17:14 
AnswerRe: is this coding correct? Pin
Christian Graus8-May-08 17:26
protectorChristian Graus8-May-08 17:26 
AnswerRe: is this coding correct? Pin
Thomas Toh8-May-08 17:31
Thomas Toh8-May-08 17:31 
GeneralRe: is this coding correct? Pin
Christian Graus8-May-08 18:03
protectorChristian Graus8-May-08 18:03 
GeneralRe: is this coding correct? Pin
Michael Martin9-May-08 3:09
professionalMichael Martin9-May-08 3:09 
RantRe: is this coding correct? PinPopular
MumbleB8-May-08 20:27
MumbleB8-May-08 20:27 
GeneralRe: is this coding correct? Pin
Jeremy Falcon9-May-08 9:07
professionalJeremy Falcon9-May-08 9:07 
AnswerRe: is this coding correct? Pin
Thomas Toh8-May-08 17:36
Thomas Toh8-May-08 17:36 
GeneralRe: is this coding correct? Pin
Christian Graus8-May-08 18:02
protectorChristian Graus8-May-08 18:02 
GeneralRe: is this coding correct? Pin
Roger Alsing8-May-08 18:56
Roger Alsing8-May-08 18:56 
GeneralRe: is this coding correct? Pin
vytheese8-May-08 18:04
professionalvytheese8-May-08 18:04 
GeneralRe: is this coding correct? Pin
Christian Graus8-May-08 19:16
protectorChristian Graus8-May-08 19:16 
AnswerRe: is this coding correct? Pin
Thomas Toh8-May-08 18:10
Thomas Toh8-May-08 18:10 

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.