473,659 Members | 3,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new webpage in same window

5 New Member
Good day
I am writing code to open every page in internet explorer and every page will be in new tab but my code open every page in separate window
could plz help me :)
I am using c#
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Net;
  9. using System.IO;
  10.  
  11. using System.Windows.Forms;
  12.  
  13. namespace RequestURLWeb
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.         }
  21.  
  22.         private void button1_Click(object sender, EventArgs e)
  23.         {
  24.             String url = textBox1.Text;
  25.             HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
  26.             HttpWebResponse respo = (HttpWebResponse)req.GetResponse();
  27.  
  28.             System.Diagnostics.Process proc = new System.Diagnostics.Process();
  29.             proc.StartInfo.FileName = "iexplore";
  30.  
  31.             proc.StartInfo.Arguments = url;
  32.             proc.Start();
  33.             System.Diagnostics.Process();
  34.  
  35.  
  36.  
  37.  
  38.  
  39.         }
  40.  
  41.         private void Form1_Load(object sender, EventArgs e)
  42.         {
  43.  
  44.         }
  45.  
  46.         private void richTextBox1_TextChanged(object sender, EventArgs e)
  47.         {
  48.  
  49.         }
  50.     }
  51. }
  52.  
Oct 17 '12 #1
1 2255
Rabbit
12,516 Recognized Expert Moderator MVP
That's because you're creating a new process each time. Instead you should create an internet explorer object and use the API for it.
Oct 18 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
15106
by: Renuka | last post by:
I have a confirmation page with an OK button. If this window has an opener then this browser window needs to go to another URL or else the window must close. Thus I have the following javascript to achieve the above which does not work: <script language="jscript"> function PageRedirection() { if(!opener)
3
21042
by: Simon Wigzell | last post by:
I just want my form target to be another page but open it in the same window. Here is my code for the 2 pages : -------------------------------form1.htm------------------------------------ <html> <body> This is form 1 <form ACTION="form2.htm" METHOD="POST" target="self"> <input type="submit" value="Submit"> </form>
1
1476
by: Danny | last post by:
hi, lately i've been working on a website and i have used a bit of javascript although i'm not an expert in this mather. On the page there are 3 thumbnails and when you click on a thumbnail a window with a picture (and text) on it opens. Each thumbnail should open a window with a different picture. So this is where the problem comes in : no matter wich thumbnail I click on, it's always the same window with the same picture that opens......
8
2032
by: Kim14 | last post by:
Help! I am trying to create a webpage and it would be obvious to anyone who reads my source code (it's a mess) that I created it using a template. I know almost nothing about webpages, but am happy with all but a few bugs in my page. I have read many posts about opening drop-downs in new windows, and have spent hours looking over my source code to see what I have done wrong.
5
36117
by: gil | last post by:
I have a form that I would like to get the values entered on the page and go to a new page in the same window. I can make the code work to open a new window, but I need it to open in the same window. Any help would be greatly appreciated. Here is what I have: function pass_info() {
0
1248
by: Husam | last post by:
Hi EveryBody: I got this decleration from msdn documntation which is: object.Navigate( _ url As String, _ _ _ _ )
8
1901
by: lli | last post by:
Hi Guys, I have designed a web application. In its one window I put a form. User can click submit button of this form to run a pathon script to get data from database. Then User get a new window which display the result. Now I want to put the form and display data on the same window. How I can do this? If I use frameset, I need to put form in a html file and put data in a table in scond html file. How I can do this?
0
1115
by: =?Utf-8?B?cGVsbGk=?= | last post by:
I create a bookmark of a folder in Windows Explorer and save in my Links folder. When I click the link from the link bar, it is opened in a new window. When I open the link from Favorites->Link->, it opens in the same Explorer window. The latter is my desired behavior for the former action. How do I make this so? I have veirified T00ls -Folder Options -Browse Folders is set to open in same window.
1
1218
by: mandarchalke29 | last post by:
Can anybody please tell me how do i set the message in the same IFRAME? I have created different windows for different users in which the url of the windows is the same. I have created IFRAMES and divisions on that window which are also the same for all the windows. The window will get refreshed after every 0.5 seconds. But when i type some message in one window it gets displayed sometimes in the same window and sometimes in different window....
1
1497
by: akiran80 | last post by:
Hi All, iam using IE 6 with SP2 patch. when am tryig to open text(spreadsheet format data) it is opening in same window. expected behaviour is it should ask for open or save option once iclick open should open in new window and show the data. but it is opening in same window. in Mozilla it works fine and IE 7 also fine but not in IE6... plz provide me solution
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.