Sign in to follow this  
Followers 0
Xizilion

Help with powerClick Login

1 post in this topic

So im trying to do a login on Powerclick by a C# webbrowser and when i pressed the login button (manually) it just refresh the page instead of login

using System;using System.Drawing;using System.Windows.Forms;using System.Net;using System.IO;namespace ClickTest{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            Browser.ScriptErrorsSuppressed = true;            Browser.Navigate(textBox1.Text, "_self", null, "User-Agent: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0");        }    private void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)        {            var elements = Browser.Document.GetElementsByTagName("input");            elements[1].SetAttribute("Value","User");            elements[2].SetAttribute("Value", "Password");            var captchaimage = Browser.Document.GetElementsByTagName("img");            listBox1.Items.Add(captchaimage[0].GetAttribute("src"));            WebClient wc = new WebClient();            byte[] bytes = wc.DownloadData(captchaimage[0].GetAttribute("src"));            Bitmap image = new Bitmap(new MemoryStream(bytes));                             }    }}

Can any1 see any problem with the code or can help me with the code

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0