Compact Framework - get error in line 'webRequest.GetRequestStream()'

Asked By funnypeck woo
05-Nov-09 09:18 PM
i'm new in mobile platform, i already find many related post for many days. i using Microsoft Visual Studio 2008, language is C#,
hope experts in forum can help me find the solution, thank you.

the code is work fine in desktop application but when move to compact
framework, some error found,one of the error show below:

below is my code

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Method = "POST";
webRequest.Timeout = 12000;
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.KeepAlive = false;

Byte[] bytes = Encoding.GetEncoding("UTF-8").GetBytes(this.Param);
Stream os = null;
WebResponse webResponse = null;
HttpWebResponse response = null;
StreamReader sr = null;
String errorMsg = "-999-" + System.Environment.NewLine;

try
{
webRequest.ContentLength = bytes.Length;
//i get the error 'System.Net.ProtocolViolationException' in this line
os = webRequest.GetRequestStream();
os.Write(bytes, 0, bytes.Length);
webResponse = webRequest.GetResponse();
sr = new StreamReader(webResponse.GetResponseStream(), System.Text.Encoding.
GetEncoding("UTF-8"));
this.Value = sr.ReadToEnd().Trim();
}

hope the following screenshot can make you more understand what problem i facing:

http://www.freeimagehosting.net/

when run in desktop application, the item inside webRequest without (!)
infront, but when move to mobile application, many item have (!) infront, i
tried to set webRequest.accept= null, but not work.
Please help.....

Prolem cause by upgrade the project to 3.5  Prolem cause by upgrade the project to 3.5

13-Nov-09 03:12 AM
after i do more testing, i found that the symbol come out after i select "upgrade project" i think HttpWebRequest not support for all platform.

after i downgrade to 2.0, i get another error, i found that StringSplitOptions is not supported, have anyone can point me a correct direction how to fix this error, thank you
Create New Account
help
visual studio installation problem Actually, my OS is Windows Xp with service pack2.I added service pack3 to install visual studio2010.after that i tryed to installed, but am getting SETUP FAILED due to "Windows XP is not installed. [08 / 10 / 11, 14:26:00] VS70pgui: [2] DepCheck indicates Microsoft Visual F# 2.0 Runtime was not attempted to be installed. [08 / 10 / 11, 14:26:00] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio Macro Tools was not attempted to be installed. [08 / 10 / 11, 14:26:00] VS70pgui attempted to be installed. [08 / 10 / 11, 14:26:00] VS70pgui: [2] DepCheck indicates .NET Framework 4 Multi-Targeting Pack was not attempted to be installed. [08 / 10 / 11, 14:26:01] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2010 Professional - ENU was not attempted to be installed. [08 / 10 / 11, 14:26
Migrating to Visual Studio.NET 2003: A Developer Perspective Migrating to Visual Studio.Net 2003: A Developer - oriented analysis By Peter A. Bromberg, Ph.D. Printer - Friendly Version Peter Bromberg A new Platform On April 24, 2003 Microsoft Windows Server 2003 and Visual Studio .NET 2003 are officially released. Many developers and beta testers (myself included) have been feverishly the Professional Developers Conference in July 2000 who received the first 6 CD distribution of Visual Studio.NET BETA 1, and I immediately recognized they had come up with something very important
Microsoft Entourage EXC_BAD_ACCESS error. Version: 2008 Operating System: Mac OS X 10.6.5 (Snow Leopard) Processor: Intel Core 2 Duo doesnt happen with all emails only with some emails. I have tried to reinstall Office 2008 yet the problem persists. Please can someone advise what the problem is as this is modules: 0: Microsoft Entourage (12.2.7.100910 Reg = en Loc = 0x0409): / Applications / Microsoft Office 2008 / Microsoft Entourage.app / Contents / MacOS / Microsoft Entourage 1: Netlib: / Applications / Microsoft Office 2008 / Microsoft Entourage.app / Contents / MacOS / . . / Frameworks / Netlib.framework / Versions / 12 / Netlib 2: MicrosoftComponentPlugin: / Applications / Microsoft Office 2008 / Microsoft Entourage.app / Contents / MacOS / . . / Frameworks / MicrosoftComponentPlugin framework / Versions / 12 / MicrosoftComponentPlugin 3: PowerPlant: / Applications / Microsoft Office 2008 / Microsoft Entourage.app / Contents / MacOS / . . / Frameworks / PowerPlant.framework / Versions / 12 / PowerPlant 4: EntourageCore: / Applications / Microsoft
how to do reporting services in visual studio 2008 hi frds how can we do reporting service in visual studio 2008 hi. . SSRS 2008 Tutorial: The Reporting Services Architecture Reporting Services has a quite a few components that work report definitions. Reports themselves can make use of data from many different data sources. SSRS 2008 Tutorial: Using Report Designer Reporting Services includes two tools for creating reports: • Report Designer can