473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Trying to Use HttpUtility Methods

I am trying to use the HttpUtility methods shown below in a Windows Form. I
cannot get Intellisense to accept the code - I've used Imports System.Web
and I also tried adding the specific name space qualifiers with the same
results? I am wondering if there is some restriction on using this in a
Windows Form?
==============================
Public Sub StartDefaultMail( _

ByVal [To] As String, _

Optional ByVal Subject As String = "", _

Optional ByVal Message As String = "" _

)

Try

Dim psi As New ProcessStartInfo

psi.UseShellExecute = True

psi.FileName = _

"mailto:" & System.Web.HttpUtility.UrlEncode([To]) & _

"?subject=" & HttpUtility.UrlEncode(Subject) & _

"&body=" & HttpUtility.UrlEncode(Message)

Process.Start(psi)

Catch ex As Exception

Throw _

New Exception( _

"Default mail client could not be started.", _

ex _

)

End Try

End Sub
Nov 20 '05 #1
2 2022
In article <OE**************@TK2MSFTNGP10.phx.gbl>,
wa***************@wengert.com says...
I am trying to use the HttpUtility methods shown below in a Windows Form. I
cannot get Intellisense to accept the code - I've used Imports System.Web
and I also tried adding the specific name space qualifiers with the same
results? I am wondering if there is some restriction on using this in a
Windows Form?


Nope. No restrictions. Did you also add a reference to System.Web.dll?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2
Patrick

I had not added the dll reference - that took care of it. Thanks

Wayne

"Patrick Steele [MVP]" <pa*****@mvps.org> wrote in message
news:MP************************@msnews.microsoft.c om...
In article <OE**************@TK2MSFTNGP10.phx.gbl>,
wa***************@wengert.com says...
I am trying to use the HttpUtility methods shown below in a Windows Form. I cannot get Intellisense to accept the code - I've used Imports System.Web and I also tried adding the specific name space qualifiers with the same
results? I am wondering if there is some restriction on using this in a
Windows Form?


Nope. No restrictions. Did you also add a reference to System.Web.dll?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: kwele | last post by:
I need to use the HttpUtility.UrlEncode method in a winform. However, the HttpUtility class is not available in intellisense from System.Web. What do I need to do to be able to use this method? ...
1
by: Muscha | last post by:
Hi, On an ASP.Net I can use UrlEncode() method to encode a URL that I want to forward using respnose.redirect, what's the equivalent of this in Windows Form? I want to be able to do open a...
4
by: Andreas Klemt | last post by:
Hello, is there a difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode ?
1
by: Brian | last post by:
I'm trying to do a POST using the following code, but I'm getting a 500 error. Can somebody please help me? I'm been stuck for quite a while. private void bnInvoke_Click(object sender,...
2
by: Marc Cardinal | last post by:
I have a need to encode and decode url content. I'm currently using the UrlDecode and UrlEncode methods from the HttpUtility class. However the code must be able to run under the .Net Internet...
1
by: Wayne Wengert | last post by:
I am building an aspx page on which I want to have a button, which when clicked opens the user's default email component (Outlook, OE, etc.). I searching the web I found the codes shown below but...
0
by: Kevin Hodgson | last post by:
I've found samples online (seem to keep finding the same one, about 100 times. ;) Basically I need to cause the default mail app to open a New Mail Message window, with some data filled in, it's...
2
by: Brett | last post by:
In one vb.net project, I can do Imports System.Web.HttpUtility and have access to the URLEncode method. In another project, the same import says HttpUtility is not a member of Web. Why...
0
by: JP | last post by:
I have a text area that I allow the users to pertty much type what they want. I started getting A potentially dangerous Request.Form value was detected from the client. I added the 2nd line to each...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.