.


:




:

































 

 

 

 


.

- , , .


ABSTRACT

The developed in the course of the course project program is disigned to query the Web pages from the internet, processing, output, and the transition from one page to another.


C#. . - .


6

1. 7

1.1. 7

1.2. 7

1.3. 8

1.4. 9

1.5. 13

1.6 14

15

17

18

, .

: ) - Visual Studio 2010 C#; ) , ; ) ; ) ; ) ; ) ; )

- Internet Explorer.

- html .

"-" web-. , .. . , .


, . . , Yandex , , -.

Visual Studio 2010, . "Web-Browser", . :

1. , ;

2. Visual Studio 2010 Professional ;

3. Visual Studio 2010 Professional ;

4. # , , , .

win-form ( , 1), ( : , , , ). (: www.google.com). , , . . , . WebBrowser , Internet. ( ):

- ;

- ;

- ;

- / ().

, Windows, .

, ,

 

:

1) Form1 - ;

2) address - ;

3) search - ;

4) back - ;

5) forward - ;

6) refresh - ;

7) stop - ;

8) home - ;

9) combobox1 - ;

10) WebBrowser wb - , .

: Key_Down - - . Click - . Document_Completed - -. Load - form1, .

:

private void Form1_Load(object sender, EventArgs e)

{

 

WindowState = FormWindowState.Maximized;

}

 

, , , .. .

private void Form1_KeyDown(object sender, KeyEventArgs e)

{

if (e.KeyCode == Keys.Back)

{

wb.GoBack();

}

}

 

BackSpace GoBack(), .

 

private void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)

{

address.Text = wb.Url.ToString();

}

 

, url , .

 

private void search_KeyDown(object sender, KeyEventArgs e)

{

if (e.KeyCode == Keys.Enter)

{

wb.Navigate("http://yandex.ru/yandsearch?text=" + search.Text + "&lr=39");

}

}

 

, . Enter yandex.ru .

private void home_Click(object sender, EventArgs e)

{

wb.Navigate("google.ru");

}

 

, , . , , .

 

, :

 

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)

{

switch (comboBox1.SelectedIndex)

{

case 0: wb.Navigate("www.vk.com"); break;

case 1: wb.Navigate("www.rambler.ru"); break;

case 2: wb.Navigate("www.rbc.ru"); break;

case 3: wb.Navigate("www.google.ru"); break;

case 4: wb.Navigate("www.yandex.ru"); break;

case 5: wb.Navigate("www.mail.ru"); break;

case 6: wb.Navigate("www.odnoklassniki.ru"); break;

case 7: wb.Navigate("www.iccup.com"); break;

case 8: wb.Navigate("www.habrahabr.ru"); break;

case 9: wb.Navigate("www.intuit.ru"); break;

case 10: wb.Navigate("www.sports.ru"); break;

case 11: wb.Navigate("www.mts.ru"); break;

}

}.

 

.

.exe. : , , , .

:

- Pentium(R) Dual-Core CPU T4200;

- 4 DDR;

- Mobile Intel(R) 45 Express;

- TOSHIBA MK3255GSX ATA Device;

- Microsoft Windows 7 .

 

:

- 1: Intel Core T4300 2.1 , 4096 , 500 , Nvidia GeForce 220M, Windows Vista.

- 2: AMD Quad-Core A8-4500M, 2.8 , 6 , 500 , Windows 7.

- 3: Intel Celeron 700 700 , 512 , 120 , Nvidia GeForce GT6600, Windows XP.

- 4:. Intel Pentium 4, 2.1 , 1024 , 320 , Nvidia GeForce GT7600, Windows XP.

:

- 1000 ;

- 256 MB ;

- 30 M ;

- SVGA 800600, 16 (65536);

- ;

- "";

- Microsoft Windows XP.


, , . # , . , Visual Studio. , , . , , , , , . , , . browse, ( ). World Wide Web , , , , . , , , , , .

, Internet Explorer , Internet Explorer ( , , , , ), ( Opera, Mozilla FireFox, Safari, Google Chrome ). , , . :

- ;

- ;

- .

 

1. C# ., , -, 2005, 866.

2. .NET Framework .. , , 2008, 531.

3. MSDN, [ ] / Microsoft Corporation. - (1 html-, 439 ). - : Microsoft Corporation, 2012. - URL: http://msdn.microsoft.com/ru-ru/library/k50ex0x9.aspx, : . - : 24.12.2012.


 

 

 

.

 

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

 

namespace

{

public partial class Form1: Form

{

public Form1()

{

InitializeComponent();

 

 

}

 

 

private void address_KeyDown(object sender, KeyEventArgs e)

{

string url = address.Text;

if (url.Length == 0 && e.KeyCode == Keys.Enter)

{

MessageBox.Show("!\n !", "ERROR!",

MessageBoxButtons.OK, MessageBoxIcon.Error);

}

 

else

{

if (e.KeyCode == Keys.Enter)

{

if (!url.StartsWith("http://") &&

!url.StartsWith("https://"))

{

url = "http://" + url;

}

 

wb.Navigate(new Uri(url));

}

 

}

}

 

private void back_Click(object sender, EventArgs e)

{

wb.GoBack();

}

 

private void forward_Click(object sender, EventArgs e)

{

wb.GoForward();

}

 

private void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)

{

address.Text = wb.Url.ToString();

}

 

private void Form1_Load(object sender, EventArgs e)

{

toolTip1.SetToolTip(address, "\n ");

WindowState = FormWindowState.Maximized;

 

}

 

private void Form1_KeyDown(object sender, KeyEventArgs e)

{

if (e.KeyCode == Keys.Back)

{

wb.GoBack();

}

 

}

 

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)

{

switch (comboBox1.SelectedIndex)

{

case 0: wb.Navigate("www.vk.com"); break;

case 1: wb.Navigate("www.rambler.ru"); break;

case 2: wb.Navigate("www.rbc.ru"); break;

case 3: wb.Navigate("www.google.ru"); break;

case 4: wb.Navigate("www.yandex.ru"); break;

case 5: wb.Navigate("www.mail.ru"); break;

case 6: wb.Navigate("www.odnoklassniki.ru"); break;

case 7: wb.Navigate("www.iccup.com"); break;

case 8: wb.Navigate("www.habrahabr.ru"); break;

case 9: wb.Navigate("www.intuit.ru"); break;

case 10: wb.Navigate("www.sports.ru"); break;

case 11: wb.Navigate("www.mts.ru"); break;

}

}

 

private void home_Click(object sender, EventArgs e)

{

wb.Navigate("google.ru");

 

}

 

private void refresh_Click(object sender, EventArgs e)

{

wb.Refresh();

}

 

private void search_KeyDown(object sender, KeyEventArgs e)

{

if (e.KeyCode == Keys.Enter)

{

wb.Navigate("http://yandex.ru/yandsearch?text=" + search.Text + "&lr=39");

}

}

 

private void stop_Click(object sender, EventArgs e)

{

wb.Stop();

}}}

 

 

.

 

 

1.

 

 



<== | ==>
Қ ӨӲ | ұ ө ү
:


: 2017-01-28; !; : 337 |


:

:

, - , ; , - .
==> ...

1458 - | 1466 -


© 2015-2024 lektsii.org - -

: 0.074 .