Click here to Skip to main content
16,020,714 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting Google Contacts Pin
Kevin Marois7-Jun-23 7:00
professionalKevin Marois7-Jun-23 7:00 
GeneralRe: Getting Google Contacts Pin
jschell8-Jun-23 6:53
jschell8-Jun-23 6:53 
GeneralRe: Getting Google Contacts Pin
Richard MacCutchan8-Jun-23 8:01
mveRichard MacCutchan8-Jun-23 8:01 
AnswerRe: Getting Google Contacts Pin
OriginalGriff6-Jun-23 23:33
mveOriginalGriff6-Jun-23 23:33 
AnswerRe: Getting Google Contacts Pin
Gerry Schmitz7-Jun-23 3:24
mveGerry Schmitz7-Jun-23 3:24 
QuestionProcess.Start() Default Browser and Detect Close Pin
Kevin Marois6-Jun-23 13:46
professionalKevin Marois6-Jun-23 13:46 
AnswerRe: Process.Start() Default Browser and Detect Close Pin
Richard Andrew x646-Jun-23 14:56
professionalRichard Andrew x646-Jun-23 14:56 
GeneralRe: Process.Start() Default Browser and Detect Close Pin
Kevin Marois6-Jun-23 17:07
professionalKevin Marois6-Jun-23 17:07 
Thanks. I set EnableRaisingEvents and it fires the event, however it fires right away as soon as Process.Start() is called. I'm hoping to handle the user closing the default browser.

I saw that page earlier. I have one question on that.

I want to open the default browser and wait for the user to close it. In this code I would have to specifically specify what browser I want.
public class Program
{
    private static Process myProcess;
    private static TaskCompletionSource eventHandled;

    public static void Main(string[] args)
    {
        StartProcess();

        Console.ReadLine();
    }

    private static async Task StartProcess()
    {
        eventHandled = new TaskCompletionSource();

        using (myProcess = new Process())
        {
            try
            {
                myProcess.StartInfo.FileName = "chrome";
                myProcess.EnableRaisingEvents = true;
                myProcess.Exited += new EventHandler(myProcess_Exited);
                myProcess.Start();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            await Task.WhenAny(eventHandled.Task, Task.Delay(30000));
        }
    }

    private static void myProcess_Exited(object sender, System.EventArgs e)
    {
        Console.WriteLine("Process exited");
        eventHandled.TrySetResult(true);
    }
}
Setting
"myProcess.StartInfo.FileName = "www.codeproject.com";"
throws an exception because that's looking for a exe to run.
In theory, theory and practice are the same. But in practice, they never are.”
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.

AnswerRe: Process.Start() Default Browser and Detect Close Pin
Richard Deeming6-Jun-23 21:46
mveRichard Deeming6-Jun-23 21:46 
AnswerRe: Process.Start() Default Browser and Detect Close Pin
jschell7-Jun-23 5:23
jschell7-Jun-23 5:23 
QuestionI've fumbled and bumbled my way though being able to read an rtsp stream, I've learned how to capture frames and Pin
Vượng Phát Nội thất4-Jun-23 16:37
Vượng Phát Nội thất4-Jun-23 16:37 
AnswerRe: I've fumbled and bumbled my way though being able to read an rtsp stream, I've learned how to capture frames and Pin
Pete O'Hanlon4-Jun-23 21:13
mvePete O'Hanlon4-Jun-23 21:13 
GeneralRe: I've fumbled and bumbled my way though being able to read an rtsp stream, I've learned how to capture frames and Pin
Richard Deeming4-Jun-23 21:42
mveRichard Deeming4-Jun-23 21:42 
QuestionSaving Data from a dynamically created form Pin
Member 136122631-Jun-23 11:41
Member 136122631-Jun-23 11:41 
AnswerRe: Saving Data from a dynamically created form Pin
Gerry Schmitz1-Jun-23 16:21
mveGerry Schmitz1-Jun-23 16:21 
GeneralRe: Saving Data from a dynamically created form Pin
Member 136122632-Jun-23 3:42
Member 136122632-Jun-23 3:42 
GeneralRe: Saving Data from a dynamically created form Pin
Gerry Schmitz2-Jun-23 4:39
mveGerry Schmitz2-Jun-23 4:39 
QuestionRe: Saving Data from a dynamically created form Pin
Ralf Meier2-Jun-23 4:40
mveRalf Meier2-Jun-23 4:40 
AnswerRe: Saving Data from a dynamically created form Pin
jschell2-Jun-23 11:32
jschell2-Jun-23 11:32 
AnswerRe: Saving Data from a dynamically created form Pin
OriginalGriff2-Jun-23 19:56
mveOriginalGriff2-Jun-23 19:56 
Questionimplementing the system tray for my C# login app Pin
Shylaja D30-May-23 23:49
Shylaja D30-May-23 23:49 
GeneralRe: implementing the system tray for my C# login app Pin
harold aptroot31-May-23 0:13
harold aptroot31-May-23 0:13 
QuestionHello, I have a question. Can I design programs with a graphical interface in C#, Dot Net Core technology, and these programs work on the DOS operating system, such as Norton Ghost Bragg? Thank you. Pin
Hero2016 Elmaghraby30-May-23 6:39
Hero2016 Elmaghraby30-May-23 6:39 
AnswerRe: Hello, I have a question. Can I design programs with a graphical interface in C#, Dot Net Core technology, and these programs work on the DOS operating system, such as Norton Ghost Bragg? Thank you. Pin
OriginalGriff30-May-23 6:42
mveOriginalGriff30-May-23 6:42 
GeneralRe: Hello, I have a question. Can I design programs with a graphical interface in C#, Dot Net Core technology, and these programs work on the DOS operating system, such as Norton Ghost Bragg? Thank you. Pin
Richard Deeming30-May-23 21:07
mveRichard Deeming30-May-23 21:07 

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.