|
Hi Friends
how to use net send utility through C#.net.
Abhishek
Mumbai, India
|
|
|
|
|
have alook at this method...
Process.Start (String, String)
I thikn that should help you
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Thanks Rocky
But there is no such overload of start method
I m giving u the code
Process proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "cmd.exe";
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.StartInfo.Arguments = "cd\\";
proc.Start();
proc.WaitForExit();
But i m nt getting whats wrong in this code.
Abhishek
Mumbai, India
|
|
|
|
|
Are there any error messages (how do you know it's wrong)?
By the way, if u want to change the current dir, use System.IO.Directory.SetCurrentDirectory(string).
Greetings - Gajatko
|
|
|
|
|
The function of below line is to pass the arguments to the commandline
and i m passing "cd\" as an argument but still the cursor is not in "c:\"
it is present where my project folder presents.
proc.StartInfo.Arguments = "".
Abhishek
Mumbai, India
|
|
|
|
|
well first of all chk out this URL in ur MSDN
that is incase if your using 2005!
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref6/html/M_System_Diagnostics_Process_Start_1_d460c748.htm
and now lets come to the code..
if you follow my method I think it should be as straight forward as this..
Process.Start("location of Netsend's exe file","inline arguments");
the problem I see in urcode is that your trying to execute CMD.Exe and the arguments ur giving are not starting Netsend are they... It's just cd\ command and you know what it does!!
Hope that's helpful for u
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Thanks Rocky
Ya U r right
the problem was that i was giving the wrong agruments. It
should be like this.
proc.StartInfo.Arguments = "/c net send abhi test";
Now its working...
Thanks a lot .
Abhishek
Mumbai, India
|
|
|
|
|
ur welcome Man jsut dont forget to vote for the msg that helps you out
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
MSDN says:
Process.Start (String, String) Starts a process resource by specifying the name of an application and a set of command-line arguments, and associates the resource with a new Process component.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I will try with this also.
Abhishek
Mumbai, India
|
|
|
|
|
First of all, I'm really sorry for my english, hope youll understand what I'm asking for...
I need to define a class contains fields as strings and integers,
a constructor, properties and Set/Get function.
In main(), I need to creat an object of this class and access it's info.
I need to create a sub-class (I think it's called this way... which goes by "class x:y" syntex...),
to add fields in it, Set/Get function, properties, and define an object in main().
I know it sounds lots of work, but actually it's nothing for you guys.
I'm not asking you to write one especially for me, but if you have an example code - i'll be gratefull!!!
Thank you in advance!
|
|
|
|
|
This is really basic stuff, have you thought about buying a book ?
public class A
{
public class B
{
private int _i;
public int I
{
get { return _i; }
set { _i = value; }
}
public B()
{
_i = 42;
}
}
}
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I suggest you buy a book on C# and study it. You will learn nothing from our answers. This looks a lot like home work. You will get stuck again in the next excercise and then maybe nobody here will be nice to you. Being a programmer is a great job but it takes a lot of pain to learn.
Rudolf Heijink
|
|
|
|
|
As i am searching for the function arguments of shell32.dll i used OllyDbg debugger there is still problem that i am only getting the name of the function.
I there any technique in OllyDbg or dumpbin.exe to find the arguments in any dll.
I searched for it on Google but not get any successfully answer.
Can some one guideline me what technique i use to get my desire requrment.
|
|
|
|
|
www.pinvoke.net[^] is a good place to look
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Mr Graus
I have a problem i am not a regular net user and want to discover how to get the arguments of functions use in dll. There for I am using OllyDbg tool but i have not familiar with this tool there for how to crack dll from this OllyDbg i need some guideline but unfortunately i have asked this question in many forms but not satisfied. You give me the link of www.pinvoke.net there are all dll function are define but question is that how they get the arguments of the dll. There are some dll that are not mention in the website there for i want to discover by myself manually.
I think you git what i want.
Now you can give me any useful suggestions.
I am waiting.
And thank for reply.
|
|
|
|
|
Hi
I am builduing a project in c# and vs .net 2003. I want a custom trackbar control with an appearance I want. I can show the snapshot, but i do not know how to upload it here?Please help.
|
|
|
|
|
Upload your snapshot to something like flickr or some free webhost account, then post the link to the snapshot.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i have two interfaces i1 and i2;
both of them have got a function with the same name
i1- function_some();
i2- function_some();
now i am gonna implement both the interfaces to a class
how do i define the functions after implementing....
of i1 and i2 respectively
thanks bye
|
|
|
|
|
You will scope them explicitly.
void i1.function_some()
{
// body
}
void i2.function_some()
{
// body
}
Now, if you try to call function_some on your class instance, you'll get an error, you'll need to scope it there, too, I am not sure if there's a way to do this, apart from casting to the right interface.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
class c
{
void i1.function_some()
{
// body
}
void i2.function_some()
{
// body
}
}
class c1:c
{
c dd =new c();
dd.//how do i call particular funcion
}
if i inherit the class where i implemented how do i call these
in the inherited class
|
|
|
|
|
As already mentioned - cast it to the correct interface:
((i2)dd).function_some()
If you need to do this your OO design is most likely wrong though.
|
|
|
|
|
thnx
i have used things in the similar manner
but it didnt strike me
thanx
|
|
|
|
|
Christian Graus wrote: You will scope them explicitly.
Not necessarily:
interface I1
{
void TheMethod();
}
interface I2
{
void TheMethod();
}
class C : I1, I2
{
public void TheMethod()
{
Console.WriteLine("Did you ask for me?");
}
}
public static int Main(string[] args)
{
C c = new C();
I1 i1 = new C();
I2 i2 = new C();
c.TheMethod();
i1.TheMethod();
i2.TheMethod();
return 0;
} However, I agree that it's bad design.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Right, if the contracts of both interfaces can be satisfied with one method, then things are simple. Until I read this thread I didn't know any other way existed.
A class that implements more than one interface may need to provide a separate implementation for each.
|
|
|
|