User Profile

Collapse

Profile Sidebar

Collapse
Prodian
Prodian
Last Activity: Mar 27 '08, 06:07 PM
Joined: Jan 26 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Prodian
    replied to C# Process Monitoring
    in .NET
    If anybody is interested I got this working as well, at first it was using 100% cpu until I added the Thread.Sleep:

    Code:
    private void StillRunning(object result)
            {
    
    
                if (!InvokeRequired)
                {
                    
                        Start.Visible = false;
                    
                        stop.Visible = true;
    ...
    See more | Go to post

    Leave a comment:


  • Prodian
    replied to C# StreamWriter doubling every line
    in .NET
    I figured it out. Had the the stream writer in the wrong place. heres how i fixed it.
    Code:
    delegate void AddTextCallback(string text);
           
                void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
                {
                    this.AddText(e.Data);
    
                    string path = "Log.txt";
     
                    using (StreamWriter sw = File.AppendText(path))
    ...
    See more | Go to post

    Leave a comment:


  • Prodian
    replied to C# StreamWriter doubling every line
    in .NET
    I still havent figured this one out, help please? Thanks!
    See more | Go to post

    Leave a comment:


  • Prodian
    replied to C# Process Monitoring
    in .NET
    Ive used this method in other programs and it loops fine. I think the problem is the null part. If I put the done = true on both ifs it doesnt freeze but when its only on the == if, the program freezes.no errors. Is there another way Ican monitor to check to see if the process is still running?
    See more | Go to post

    Leave a comment:


  • Prodian
    started a topic C# Process Monitoring
    in .NET

    C# Process Monitoring

    Im trying to monitor a process until the process ends but the program keeps freezing during the while loop and wont keep running. Heres what I have so far:

    Code:
    private void ProcessCheck()
            { 
                bool done = false;
                while (!done)
                    {
                       
                     System.Diagnostics.Process[] myProcesses;
                myProcesses =
    ...
    See more | Go to post

  • Prodian
    replied to C# StreamWriter doubling every line
    in .NET
    so does anybody an idea whats wrong?
    See more | Go to post

    Leave a comment:


  • Prodian
    started a topic C# StreamWriter doubling every line
    in .NET

    C# StreamWriter doubling every line

    The outputBox.Text is NOT getting double the lines, the Text file is getting every line of output double. The output is correct everything is working fine, but its writing everything twice in my log file. Can anybody see why? Thanks.

    Here is the code:
    Code:
           
    private void outPut()
     {
                
                Process process = new Process();
                process.StartInfo.UseShellExecute
    ...
    See more | Go to post

  • Prodian
    replied to C# Changing Rich Textbox Color
    in .NET
    The occurance of the text is random, all I can think of is to somehow say when this text "Email Sent" has been read from the other program change SelectedColor property then change back like you said....
    See more | Go to post

    Leave a comment:


  • Prodian
    started a topic C# Changing Rich Textbox Color
    in .NET

    C# Changing Rich Textbox Color

    I using the following code to start a process and redirect the output to a rich textbox. This is working fine but now I want to change the font color for certain text lines for example:

    TextLine(plain text)
    TestLine(plain text)
    EMAIL MESSAGE SENT (in red or whatever)
    TestLine(plain text)
    TestLine(plain text)


    Code:
    private void Form1_Load(object sender, EventArgs e)
            {
    ...
    See more | Go to post

  • Prodian
    replied to Parse string and grab only certain data
    in .NET
    I did this instead:
    Code:
    string macOut = "Internet      204.189.124.205   16  0000.0c07.ac01   ARPA Vlan101";
    
                Regex r = new Regex(" +");
                string [] splitString = r.Split(macOut);
    
                string PartWanted = splitString[3];
    Thanks for the help.
    See more | Go to post

    Leave a comment:


  • Prodian
    replied to Parse string and grab only certain data
    in .NET
    Thanks for the help, thats working fine when theres one space between each word but on the telnet output it could be 1 space or 5 spaces. Anyway around this?
    See more | Go to post

    Leave a comment:


  • Prodian
    started a topic Parse string and grab only certain data
    in .NET

    Parse string and grab only certain data

    Im trying to parse a recv from a telnet session then only grab certain data.

    Heres an example of the recv that Im storing into a string:

    Internet 204.189.124.205 0 001a.a01f.4e5a ARPA Vlan122

    The only part I want is the mac address which is in bold.

    Im trying to parse it while running it into a for loop so when it gets to the 4th section it will store that in another string....
    See more | Go to post

  • Prodian
    started a topic Append variable to string
    in .NET

    Append variable to string

    Ok so Im trying to append a variable to the end of a string variable. Heres what Im doing but its not working:

    Code:
    string command = ("do this command now {0}",textbox1.text);
    what Im really trying to do is set a command in telnet for a router command to append an textbox.text to whatever the user input in the text box. it send it fine with just the command stored into the string but not when I try to add the...
    See more | Go to post

  • Prodian
    started a topic problem writing to an ini file
    in .NET

    problem writing to an ini file

    Im using NINI parser to read and write to an ini file. Everythings working fine, its reading and writing but lets say I read in these vaules:

    Code:
    [Settings]
    Test=1
    Off=0
    On=1[Settings]
    Test=1
    Off=0
    On=1
    It reads them fine but now lets say I change a 1 to 0. It writes back Test = 0. Theres spaces on both sides of the equal sign. Anybody have a niffty way so when Im writing...
    See more | Go to post

  • Prodian
    replied to Checkbox State Question
    its C# visual, but i got it working with this
    Code:
    if (use_smtp.Checked == true)
                {
                    source.Configs["Settings"].Set("use_smtp","1");
                }
                else
                {
                    source.Configs["Settings"].Set("use_smtp","0");
                }
    See more | Go to post

    Leave a comment:


  • Prodian
    started a topic Checkbox State Question

    Checkbox State Question

    This is my first post so be easy on me please.

    Im using a INI parser to read and write to an ini file. When reading the ini file I have certain parameters set to 1 or 0, which need to be stored to a checkbox variable. Heres a peice of code for reading the ini file.

    Code:
                string whispernotify = source.Configs["Settings"].Get("whisper_notify");
                
                if
    ...
    See more | Go to post
No activity results to display
Show More
Working...