CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Weird Error.

  1. #1
    Join Date
    Apr 2008
    Posts
    3

    Weird Error.

    Every time I try to connect to the site, I always get Access forbidden or proxy timed out. Even though I try all the proxies in Access diver and on Firefox and i also access the url.

    Here is the code:

    Code:
    private void Create()
            {
                if (listBox1.Items.Count == 0)
                {
                    MessageBox.Show("Error, Please load a file into the listbox.", "Empty Box");
                    return;
                }
                if (listBox3.Items.Count == 0)
                {
                    MessageBox.Show("Error, Please load a file into the listbox.", "Empty Box");
                    return;
                }
                if (textBox4.Text.Length < 5)
                {
                    MessageBox.Show("The password you have selected is too short to use on RuneScape", "Password Too Short");
                    return;
                }
                if (textBox4.Text.Length > 20)
                {
                    MessageBox.Show("The password you have selected is too long to use on RuneScape", "Password Too long");
                    return;
                }
    
                listBox1.Enabled = false;
                listBox3.Enabled = false;
                textBox1.Enabled = false;
                textBox3.Enabled = false;
                vistaButton1.Enabled = false;
                vistaButton9.Enabled = false;
                vistaButton8.Enabled = false;
                vistaButton2.Enabled = false;
                vistaButton3.Enabled = false;
                vistaButton7.Enabled = false;
                vistaButton10.Enabled = false;
                textBox4.Enabled = false;
    
                for (int i = 0; i < listBox1.Items.Count; i++)
    			{
                    try
                    {
                        if (vistaButton11.Enabled == false)
                        {
                            goto Label_Done;
                        }
                    Label_ProxyError:
                        listBox1.SelectedIndex = i;
                        if (ProxyCount > listBox3.Items.Count)
                        {
                            ProxyCount = 0;
                        }
                        label8.Text = "Created Accounts: " + CreatedCount;
                        label9.Text = "Failed Accounts: " + FailedCounts;
                        label10.Text = "Blocked Attempts: " + BlockedCount;
                        listBox3.SelectedIndex = ProxyCount;
                        WebClient WC = new WebClient();
                        String Username = listBox1.Items[CreatedCount] + "";
                        String Password = textBox4.Text;
                        String URL = "https://create.runescape.com/createaccount.ws?country=225&agerange=2&username=" + Username + "&password1=" + Password + "&password2=" + Password + "&termsandcond=1&submit=Create+Account"; ;
                        String TheWholeProxy = listBox3.Items[ProxyCount] + "";
                        string[] AddressAndPort = TheWholeProxy.Split(new Char[] { ':' });
                        string Address = AddressAndPort[0];
                        int Port = Convert.ToInt32(AddressAndPort[1]);
                        WebProxy WP = new WebProxy(Address, Port);
                        WebRequest Request = WebRequest.Create(URL);
                        Request.Timeout = int.Parse(textBox2.Text);
                        Request.Proxy = WP;
                        HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();
                        System.IO.StreamReader Stream = new StreamReader(Request.GetResponse().GetResponseStream());
                        String RecievedData = Stream.ReadToEnd();
    
                        if (RecievedData.IndexOf("You have been blocked") > -1)
                        {
                            MessageBox.Show("Your IP Address Has Been Blocked");
                            LogDebug.Add(DateTime.Now + ": Your Ip Address has been blocked by RuneScape, Now Switching Proxies");
                            ProxyCount = ProxyCount + 1;
                            if (ProxyCount > listBox3.Items.Count)
                            {
                                ProxyCount = 0;
                            }
                            BlockedCount = BlockedCount + 1;
                            goto Label_ProxyError;
                        }
                        if (RecievedData.IndexOf("Sorry") > -1)
                        {
                            MessageBox.Show("Your Account Has Been Taken");
                            LogDebug.Add(DateTime.Now + ": Account(" + listBox1.Items[i] + " Was not available");
                            FailedCounts = FailedCounts + 1;
                        }
                        if (RecievedData.IndexOf("Your Account") > -1)
                        {
                            MessageBox.Show("Your Account Has Been Created");
                            CreatedAccounts.Add("Username: " + listBox1.Items[i] + " : Password: " + textBox4.Text);
                            LogDebug.Add(DateTime.Now + ": Account (" + listBox1.Items[i] + ") Was Created");
                            CreatedCount = CreatedCount + 1;
                        }
                        
    
                    }
                    catch (WebException e)
                    {
                        MessageBox.Show(e.Message);
                        if (ProxyCount > listBox3.Items.Count)
                        {
                            ProxyCount = 0;
                        }
                        ProxyCount = ProxyCount + 1;
                        i = i - 1;
                    }
                }
            Label_Done:
                listBox1.SelectedIndex = 0;
                listBox3.SelectedIndex = 0;
                listBox1.Enabled = true;
                listBox3.Enabled = true;
                textBox1.Enabled = true;
                textBox3.Enabled = true;
                textBox4.Enabled = true;
                vistaButton1.Enabled = true;
                vistaButton9.Enabled = true;
                vistaButton8.Enabled = true;
                vistaButton2.Enabled = true;
                vistaButton3.Enabled = true;
                vistaButton7.Enabled = true;
                vistaButton10.Enabled = true;
                SaveAccounts();
            }

    Thanks,
    Buckley.

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Weird Error.

    I see the you are calling to secured "https://" site, but I cannot see you would pass any certificate to the server. Are you sure that you don't need one?
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured