How to open multiple urls from richtextbox

I have this code to open multiple URLs from richtextbox, it works fine, but the problem is that it opens all sites in different browsers.

private void button1_Click(object sender, EventArgs e) { for(int i = 0 ; i < richTextBox1.Lines.Length ; i++ ) { Process.Start("http://" + richTextBox1.Lines[i]); } } 

Any ideas on how I can open pages, such as tabs in one browser?

+5
source share
2 answers

It worked for me ...

 private void button1_Click(object sender, EventArgs e) { foreach (string item in richTextBox1.Lines) { if (!string.IsNullOrEmpty(item)) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "firefox.exe"; startInfo.Arguments = "-new-tab " + item; Process.Start(startInfo); } } } 
+1
source

Please check it:

http://kb.mozillazine.org/Command_line_arguments

The following should work according to the article;

 firefox.exe -new-tab <url> 
0
source

Source: https://habr.com/ru/post/1209266/


All Articles