[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

get error in line 'webRequest.GetRequestStream()'

funnypeck

11/4/2009 2:48:00 AM

i'm new in mobile development, i already find many related post for many days,
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 = this.TimeOutMiliSecs;
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 picture below can make you more understand what problem i facing:
http://www.freeimagehosting.net/uploads/8b31...

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.....Thank you.

3 Answers

sheldonlg

7/29/2010 9:27:00 PM

0


"mm" <NOPSAMmm2005@bigfoot.com> wrote in message
news:qqr356p0rshe6lbpeik7imop489tiilt9o@4ax.com...
> On Thu, 29 Jul 2010 21:13:26 +0000 (UTC), "sheldonlg"
> <sheldonlg@thevillages.net> wrote:
>
>>
>>"Don Levey" <Don_SCJM@the-leveys.us> wrote in message
>>news:i2spna$uud$1@news.eternal-september.org...
>>> From the Christian Science Monitor:
>>>
>>> http://www.csmonitor.com/Commentary/Opinion/2010/0729/For-biased-critics-of-Israel-even-its-defensive-actions-violate-hu...
>>>
>>> The title pretty much sums it up.
>>
>>While I think Cristian Science is a crock, they do put out a good
>>newspaper.
>>I haven't read it in decades, but it was always (then, at least) the most
>>even-handed and unbiased reporting available.
>
> They inteviewed some one from the "paper" on the radio about a month
> ago, and someone callled in wanting to know if it was against the law
> for them to have a paper, and when told it wasn't, he said "I don't
> like it." Again, I came in in the middle, but I don't think he even
> knew about them before hearing the radio show, and I'll bet he never
> read anything they write.

......and???????


DoD

7/29/2010 9:39:00 PM

0



"sheldonlg" <sheldonlg@thevillages.net> wrote in message
news:KsSdnZ4HL5YPcMzRnZ2dnUVZ_uednZ2d@giganews.com...
>
> "Don Levey" <Don_SCJM@the-leveys.us> wrote in message
> news:i2spna$uud$1@news.eternal-september.org...
>> From the Christian Science Monitor:
>>
>> http://www.csmonitor.com/Commentary/Opinion/2010/0729/For-biased-critics-of-Israel-even-its-defensive-actions-violate-hu...
>>
>> The title pretty much sums it up.
>
> While I think Cristian Science is a crock, they do put out a good
> newspaper. I haven't read it in decades, but it was always (then, at
> least) the most even-handed and unbiased reporting available.

From my perspective, CSM is not very Christian, certainly not scientific,
and not worthy to monitor elephant
droppings at the local zoo. Over the years I have caught them too many
times with an anti-Jewish/Israel bias.....

I bet CAMERA or Honestreporting have them on file......

David

Yussel

7/30/2010 4:10:00 AM

0

On Jul 29, 5:23 pm, mm <NOPSAMmm2...@bigfoot.com> wrote:
> On Thu, 29 Jul 2010 21:13:26 +0000 (UTC), "sheldonlg"
>
> <sheldo...@thevillages.net> wrote:
>
> >"Don Levey" <Don_S...@the-leveys.us> wrote in message
> >news:i2spna$uud$1@news.eternal-september.org...
> >> From the Christian Science Monitor:
>
> >>http://www.csmonitor.com/Commentary/Opinion/2010/0729/For-b......
>
> >> The title pretty much sums it up.
>
> >While I think Cristian Science is a crock, they do put out a good newspaper.
> >I haven't read it in decades, but it was always (then, at least) the most
> >even-handed and unbiased reporting available.
>
> They inteviewed some one from the "paper" on the radio about a month
> ago, and someone callled in wanting to know if it was against the law
> for them to have a paper, and when told it wasn't, he said "I don't
> like it."   Again, I came in in the middle, but I don't think he even
> knew about them before hearing the radio show, and I'll bet he never
> read anything they write.
>
> --
>
> Meir
>
> "The baby's name is Shlomo. He's named after his grandfather, Scott."

The Mormon Church owns the Deseret News in Salt Lake City.

Joel