Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello, I'm developing a WPF application which uses twitterizer. My app works as following.
1. User clicks login button from WPF application
2. twitter website opens in default browser
3. a pin is generated from twitter
4. user manually enters that pin to WPF form
5. Now, i want to close that browser tab via c# code

Is there any way to close a single tab of IE, firefox or chrome?
If its not possible, then please describe the way so that a new browser process opens and then can be closed via c# code.
Posted

Maybe executing external process is not a good idea in principle. You can do it, but this is problematic and lacks reliability. Processes are well isolated, unless they designed with the use of some technology for collaboration, IPC. Consider using Web browser embedded in your application:
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx[^].

—SA
 
Share this answer
 
Agreed with SA.

you can use web browser control in your WPF application for this purpose.

http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/web-browser-control-in-wpf/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900