Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: Save data Pin
Star0926-Apr-09 8:38
Star0926-Apr-09 8:38 
QuestionWPF DatePiker Pin
Mohammed Elkholy26-Apr-09 5:37
Mohammed Elkholy26-Apr-09 5:37 
QuestionRe: WPF DatePiker Pin
fly90426-Apr-09 5:57
fly90426-Apr-09 5:57 
AnswerRe: WPF DatePiker Pin
Mohammed Elkholy26-Apr-09 11:36
Mohammed Elkholy26-Apr-09 11:36 
GeneralRe: WPF DatePiker Pin
fly90426-Apr-09 11:56
fly90426-Apr-09 11:56 
GeneralRe: WPF DatePiker Pin
Mohammed Elkholy26-Apr-09 12:01
Mohammed Elkholy26-Apr-09 12:01 
GeneralRe: WPF DatePiker Pin
Mohammed Elkholy28-Apr-09 2:14
Mohammed Elkholy28-Apr-09 2:14 
QuestionSending requst with sent cookies Pin
Gindi Bar Yahav26-Apr-09 5:36
Gindi Bar Yahav26-Apr-09 5:36 
Hey,
I want to ask for your help:
i am in the middle of building a program using C#, the program have to read XML file from the net that including the information about the member that logind in (this is a website) and display it in the program.
the problem is that when i do the requst it not send any cookies with the requst, so the xml return guest, how can i get with C# the cookies that was sendin the website to send them?

example: i have loggind in the website with "gindi bar yahav", "123321" - the web set cookies on my computer, now i want to get those cookies with C# becuse i need to use them when i requst from the XML file.

that was the code i used

try
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(this.xml_file);
    request.Method = "GET";

    //  Fetch cookies

    CookieContainer web_cookies = new CookieContainer();
    CookieContainer cookies = web_cookies.GetCookies(new Uri("http://otaku-con.co.il"));
    request.CookieContainer = cookies;
    //  Send
    HttpWebResponse resp = (HttpWebResponse) request.GetResponse();

    st = resp.GetResponseStream();
    sr = new System.IO.StreamReader(st);

    // read all the text in it
    System.Windows.Forms.MessageBox.Show(sr.ReadToEnd().ToString());
}
catch(Exception e)
{
    System.Windows.Forms.MessageBox.Show(e.ToString());
    System.Windows.Forms.Application.Exit();
}


when i get the message it gave me "Array()" what means i dont have any cookies (in the page i tried only to print the cookies [with PHP]) but when i go to the page with the browser i can see all my cookies.

someone know what the problem?

thanks alot, Yahav.

Gindi Bar Yahav - Web & Software defeloper.

Question[Message Deleted] Pin
hkjghkj126-Apr-09 3:34
hkjghkj126-Apr-09 3:34 
AnswerRe: Button positioning Pin
Luc Pattyn26-Apr-09 3:46
sitebuilderLuc Pattyn26-Apr-09 3:46 
QuestionSimple video player with subtitles? Pin
neonova26-Apr-09 2:06
neonova26-Apr-09 2:06 
AnswerRe: Simple video player with subtitles? Pin
harold aptroot26-Apr-09 3:09
harold aptroot26-Apr-09 3:09 
GeneralRe: Simple video player with subtitles? Pin
neonova26-Apr-09 7:19
neonova26-Apr-09 7:19 
GeneralRe: Simple video player with subtitles? Pin
harold aptroot26-Apr-09 7:34
harold aptroot26-Apr-09 7:34 
QuestionSingle Instance and Task Scheduler Creating Trouble. Pin
Dev S26-Apr-09 2:04
Dev S26-Apr-09 2:04 
AnswerRe: Single Instance and Task Scheduler Creating Trouble. Pin
Joel Ivory Johnson26-Apr-09 3:53
professionalJoel Ivory Johnson26-Apr-09 3:53 
QuestionHow to hide process !!! Pin
elther326-Apr-09 1:26
elther326-Apr-09 1:26 
AnswerRe: How to hide process !!! Pin
Christian Graus26-Apr-09 1:33
protectorChristian Graus26-Apr-09 1:33 
AnswerRe: How to hide process !!! Pin
fly90426-Apr-09 1:37
fly90426-Apr-09 1:37 
GeneralRe: How to hide process !!! Pin
Member 429057725-May-10 20:05
Member 429057725-May-10 20:05 
AnswerRe: How to hide process !!! Pin
harold aptroot26-Apr-09 3:08
harold aptroot26-Apr-09 3:08 
QuestionStruggling to find a suitable data structure Pin
Jastons25-Apr-09 23:20
Jastons25-Apr-09 23:20 
AnswerRe: Struggling to find a suitable data structure Pin
Moreno Airoldi26-Apr-09 0:26
Moreno Airoldi26-Apr-09 0:26 
GeneralRe: Struggling to find a suitable data structure Pin
Jastons26-Apr-09 0:59
Jastons26-Apr-09 0:59 
AnswerRe: Struggling to find a suitable data structure Pin
Gary R. Wheeler26-Apr-09 0:30
Gary R. Wheeler26-Apr-09 0:30 

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.