0

Ok so it logs in fine using

public bool Login()
        {
            string postdata = string.Format("m=login&nextURL=http%3A%2F%2Fwww.ijji.com%2Findex.nhn&memberid={0}&password={1}", encode(Username), encode(Password));
            string result = post(_url + "login.nhn", postdata);
            return !(result.Contains("You have entered an incorrect password") || result.Contains("User ID is not found"));
        }
        public string GetCookies() { return Cookies.GetCookieHeader(new Uri("http://ijji.com/")); }

then it when trying to get the cookies to an inside browser it errors

if (Logins.Login())
                {
                    IDC_Browse.Navigate("javascript:cookie=\"" + Logins.GetCookies() + "\";"); // <-- that line
                    IDC_Browse.Navigate("javascript:goPlay('u_gunz', '');");
                }

the Logins.GetCookies(); is returning a null reference.

"NullReferenceException was caught"
"Object reference not set to an instance of an object."

Basically - i need it to store the cookies from the login and ship them into the C# web browser control then run that second lot of javascript :)

Any ideas?

2
Contributors
8
Replies
9
Views
8 Years
Discussion Span
Last Post by FTProtocol
0

But its not the same instance.. So, its not going to have the same cookies. You would need to grab and set the cookies at the time you login

0

But its not the same instance.. So, its not going to have the same cookies. You would need to grab and set the cookies at the time you login

how?

0

Set the cookie when you make the login call..

yeah............ I don't understand :(

0

Thats obvious.
Did you cut and paste the code you have? You have a login function, you need to collect the cookies and store them within the login function..

0

Thats obvious.
Did you cut and paste the code you have? You have a login function, you need to collect the cookies and store them within the login function..

ive only been coding in C# for around a month so i have no idea about cookies

0

cookies are not a c# thing, but a web thing.

yes what i meant is i have no idea how to keep them from the login and inject them into the webbrowser control so i can from there
execute javascript

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.