Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
Questionhow to make exception serializable Pin
George_George12-Nov-08 14:22
George_George12-Nov-08 14:22 
AnswerRe: how to make exception serializable Pin
N a v a n e e t h12-Nov-08 17:03
N a v a n e e t h12-Nov-08 17:03 
GeneralRe: how to make exception serializable Pin
George_George12-Nov-08 17:52
George_George12-Nov-08 17:52 
GeneralRe: how to make exception serializable Pin
N a v a n e e t h12-Nov-08 19:38
N a v a n e e t h12-Nov-08 19:38 
GeneralRe: how to make exception serializable Pin
George_George12-Nov-08 21:25
George_George12-Nov-08 21:25 
GeneralRe: how to make exception serializable Pin
N a v a n e e t h13-Nov-08 15:09
N a v a n e e t h13-Nov-08 15:09 
GeneralRe: how to make exception serializable Pin
George_George16-Nov-08 2:15
George_George16-Nov-08 2:15 
QuestionC# HttpWebRequest + Cookie ¿Sessions? Pin
fasfasdf12-Nov-08 14:14
fasfasdf12-Nov-08 14:14 
Im trying to send some GET and POST request to a website with the HttpWebRequest control.
The problem is that the server is giving me blank reponses when i try to do a post, and this is because the cookie i send doesnt have utma, utmz and utmc values, but i have no idea how to setup this variables, i tought they were gonna be set automatic like in the browser cause as far i know is for session tracking, but no

heres an example of the cookie values i dont know how to get/generate, sniffed from mozilla 3.0.3

__utma=56969722.1488837505.1226268589.1226445794.1226522343.8;__utmz=56969722.1226268589.1.1.utmccn= (direct)|utmcsr=(direct)|utmcmd=(none);__utmc=56969722;");

and heres my c# code
Code:
try
 {
     req = (HttpWebRequest)WebRequest.Create("http://www.domain.com/");
     myWebHeaderCollection = req.Headers;
     myWebHeaderCollection.Set("Accept-Language", "en-us;q=0.5,en;q=0.3");
     myWebHeaderCollection.Set("Accept-Encoding", "gzip,deflate");
     myWebHeaderCollection.Set("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
     req.KeepAlive = true;
     req.ServicePoint.Expect100Continue = false;
     req.Referer = "";
     req.UserAgent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)";
     req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
     req.Method = "GET";
     req.CookieContainer = cookieContainer;
     response = (HttpWebResponse)req.GetResponse();
     //WebResponse webResponse1 = req.GetResponse();
     sr = new StreamReader(response.GetResponseStream());
     getOutput = sr.ReadToEnd();
     sr.Close();

     foreach (Cookie cook in response.Cookies)
     {
         //cook.Value();
         cookieContainer.Add(cook);
     }
 }
 catch (Exception ex)
 {
     MessageBox.Show(ex.ToString());
 }

Confused | :confused:
Any ideas how i could get this cookie?
Questionobject? Pin
dec8212-Nov-08 14:02
dec8212-Nov-08 14:02 
AnswerRe: object? Pin
Guffa12-Nov-08 14:37
Guffa12-Nov-08 14:37 
GeneralRe: object? Pin
dec8212-Nov-08 15:03
dec8212-Nov-08 15:03 
GeneralRe: object? Pin
Mbah Dhaim12-Nov-08 15:43
Mbah Dhaim12-Nov-08 15:43 
GeneralRe: object? Pin
Dave Kreskowiak12-Nov-08 15:47
mveDave Kreskowiak12-Nov-08 15:47 
GeneralRe: object? Pin
Paul Conrad12-Nov-08 17:10
professionalPaul Conrad12-Nov-08 17:10 
QuestionCrystal report crashes when report object's printer name is changed Pin
muharrem12-Nov-08 10:51
muharrem12-Nov-08 10:51 
AnswerRe: Crystal report crashes when report object's printer name is changed Pin
Paul Conrad12-Nov-08 11:16
professionalPaul Conrad12-Nov-08 11:16 
QuestionIPC Events in windows service Pin
picazo12-Nov-08 10:37
picazo12-Nov-08 10:37 
QuestionRe: IPC Events in windows service Pin
Mark Salsbery12-Nov-08 11:03
Mark Salsbery12-Nov-08 11:03 
AnswerRe: IPC Events in windows service Pin
picazo12-Nov-08 11:18
picazo12-Nov-08 11:18 
Question[Message Deleted] Pin
rhino113012-Nov-08 9:14
rhino113012-Nov-08 9:14 
AnswerRe: No Send button in Outlook Express message with automation Pin
rhino113012-Nov-08 9:43
rhino113012-Nov-08 9:43 
Questiontooltip Pin
netJP12L12-Nov-08 5:00
netJP12L12-Nov-08 5:00 
GeneralRe: tooltip Pin
led mike12-Nov-08 7:09
led mike12-Nov-08 7:09 
GeneralRe: tooltip Pin
EliottA12-Nov-08 8:44
EliottA12-Nov-08 8:44 
GeneralRe: tooltip Pin
led mike12-Nov-08 10:45
led mike12-Nov-08 10:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.