|
If you hook the mouse event you're able to play with the win32 data structures and make that sort of transform.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
That is what I was wondering, maybe the OP should try that.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I have a Remoting Application. When I Call a Remoting method in my remoting object, because network, sometime it can not return result. The client be Suspended. How to do it for timeout like connect to oracle database?
|
|
|
|
|
Override MarshalByRefObject.InitializeLifetimeService()
-- modified at 9:41 Friday 13th July, 2007
|
|
|
|
|
Hi ,
I have created an application in C# which runs varios windows commands.
For the Debugging purpose I need that whatever output I am getting to be pasted to a log file also say to C:\Log.txt file. How is it possible to redirect all the console output to a file.
Thanks in Advance
Sankalp Verma
|
|
|
|
|
<br />
using System.IO;<br />
<br />
TextWriter tw = new StreamWriter(@"C:\\Log.txt");<br />
tw.WriteLine("Enter Required Text here");<br />
tw.Flush();<br />
tw.Close();
Hope this helps.
|
|
|
|
|
Look at the TRACE namespace. You can set tracelisteners up to echo stuff to the console, to DbgVwr and a text file.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Thanks all for your valuable input but I think that i was not able to explain the problem properly.
Suppose I am using C# to run the ping command. Now once this command runs all output I get goes to the console window. Now what I want is that In place of going to the console window, can it go into a log file.
Thanks and Regards,
Sankalp Verma
|
|
|
|
|
OK - specifically for PING you can use the
System.Net.NetworkInformation.Ping . You can query this for the results of the ping.
For capturing any console output from a 'shelled' program, do something like this
<br />
System.Diagnostics.Process myProc = new System.Diagnostics.Process();<br />
myProc.StartInfo.FileName = String.Format("myprogram.exe");<br />
<br />
myProc.StartInfo.Arguments = "-args myargs";<br />
myProc.StartInfo.UseShellExecute = false;<br />
myProc.StartInfo.RedirectStandardOutput = true;<br />
<br />
myProc.Start();<br />
<br />
myProc.WaitForExit(1000 * 20);<br />
<br />
string output = myProc.StandardOutput.ReadToEnd();<br />
<br />
<br />
<br />
<br />
<br />
<div class="ForumSig"><small>"More functions should disregard input values and just return 12. It would make life easier."</small> - comment posted on WTF</div>
|
|
|
|
|
|
Hi, read up on the Process class, especially Process.StandardOutput
and StandardError.
|
|
|
|
|
Console.SetOut(File.CreateText("C:/log.txt"));
|
|
|
|
|
sanki779 wrote: For the Debugging purpose I need that whatever output I am getting to be pasted to a log file also say to C:\Log.txt file. How is it possible to redirect all the console output to a file.
If your app doesn't accept any input, don't modify it at all. Just call it from the command line and redirect the output using DOS to wherever you want.
c:\>myapp.exe > c:\log.txt
If your app needs input, naturally this won't work.
Share and enjoy.
Sean
|
|
|
|
|
Hi,
I would like to create a Text Editor using C# Windows Application, please give me some link which has basic idea of it.
|
|
|
|
|
Can do better than just a link - try this :-
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Diagnostics;<br />
<br />
namespace TextEditor<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
Process p = new Process();<br />
p.StartInfo.FileName = String.Format("notepad.exe");<br />
p.StartInfo.UseShellExecute = false;<br />
p.StartInfo.RedirectStandardOutput = true;<br />
<br />
p.Start();<br />
<br />
p.WaitForExit();<br />
<br />
p.Close();<br />
Console.WriteLine("Thank you for using my C# text editor");<br />
<br />
}<br />
}<br />
}<br />
Regards
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
To those that have just voted this down.....
Do you think the OPs question was a good one? Had he/she made any effort whatsoever to solve it? If so, they didn't say. These types of posts are slowly killing the forums.
Justify your '1' vote....unless it was Satips who voted me down, then with the amount of '1's he has accumulated, he has every right to vote me down!!
Regards
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
i think he wants to know creating own notepad not existing like windows notepad.
you are just opening windows notepad.
First and the Foremost: FIGHT TO WIN
About Me
|
|
|
|
|
I know. I was being sarcastic. Has he looked at the edit control. The Rich Text control? Has he got a problem opening a window? I always thought these forums were for specific, definitive problems. eg.
I have a window, which doesn't refresh when a button is clicked. I have tried this [ code posted ] and that didn't work. Any ideas?
or
Is there any component that would allow text to be formatted. I've used the edit box, but that is really limited.
He would then be pointed at the rich text edit control. He would then try to use that, read up on it, hit a problem, then post that problem.
His question was not a programming question. It was a concept question, one, which if there was some udnerstanding of the language he could have attempted. Look at this link - may not be exactly what he wanted, but it took me about a minute to find, and I would use this as a starting point. http://www.codeproject.com/useritems/scratchpad.asp[^] It may turn out to be no use, but then he could ask a question specific to why it isn't any use.
I am not being self righteous here, I've asked plenty of questions which peole like CG answer in their sleep, but I always try before asking.
--climbs off from his high horse, bows down, ready to receive a bucket load of 1s.---
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Spot on. You captured the spirit of the boards perfectly.
|
|
|
|
|
thanks - but it was wasted here. I've said similar in the lounge before....I reckon it's time to soapbox these txtspking homeworking single posters - i can then let loose with extreme prejudice!
....i've just posted a question here myself - watch the sarcasm come rolling in
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
It got so bad - that I wrote an article on using the forums properly. Now if only I can figure how to get the lazy b*ggers to actually read it.
|
|
|
|
|
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=84
First and the Foremost: FIGHT TO WIN
About Me
|
|
|
|
|
dear friends,
i have treeview control in asp.net 2005.
there is an option to show ckeck box.
when i click the root node check box, i want all the sub nodes to be checked.
how to do that.?
how to get onclick event of the any check box in the treeview.
by
joe
|
|
|
|
|
hi joe
the events are:
BeforCheck and AfterCheck
regards
|
|
|
|
|
Hi, i got a problem with my application. Usually I retrieve data from database and display it in datagrid. But, how to display data in Listview.
Thanx b4
Best Regards
Edwin46
|
|
|
|