Solved

c# add System.Web.dll

Posted on 2010-11-29
5
912 Views
Last Modified: 2012-06-27
How can i add  c# add System.Web.dll

the error show
Error      1      The name 'HttpUtiltity' does not exist in the current context      C:\Users\¿¿¿7\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs      28      21      WindowsFormsApplication1

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;
using System.Web;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string searchString = "song naran"; //or some value retrieved from a form

            System.Diagnostics.Process.Start(
                @"E:\Program Files\Mozilla Firefox\firefox.exe",
                String.Format(
                    "http://www.bing.com/search?q={0} http://search.yahoo.com/search?p={0}",
                    HttpUtiltity.UrlEncode(searchString)));



        }
    }
}

Open in new window

systemweb.png
0
Comment
Question by:teera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 10

Accepted Solution

by:
james-ct16 earned 167 total points
ID: 34229709
Howdy
Are you building this project against a Client Profile version of the .net framework if so System.Web is not included in the profile.

To check this simply select the project, right click and select properties, on the application tab there is the target framework, try switching this to framework 4 opposed to framework 4 client profile.

Hope that helps

James
0
 
LVL 5

Expert Comment

by:roxviper
ID: 34229767
Hi,

Please select it from add reference dialog
0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 166 total points
ID: 34229873
Since yuo are creating a WinForms application, System.Web isn't included by default.

Right-click your project, choose "Add Reference". In the dialog that appears, scroll down to System.Web; select it and hit "OK".
0
 
LVL 4

Assisted Solution

by:ricovox
ricovox earned 167 total points
ID: 34230593
To add to what carl_tawn said:

System.Web isn't included by default.
Right-click your project, choose "Add Reference".
In the dialog that appears, scroll down to System.Web; select it and hit "OK".

Make sure that you are on the ".NET" tab in the "Add Reference" dialog.
0
 

Author Closing Comment

by:teera
ID: 34235561
thank you
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question