本文介绍了FindPageRankBtn_Click'不是'ASP.default_aspx的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net vb项目..我坚持以下错误消息..请帮帮我。

FindPageRankBtn_Click'不是'ASP.default_aspx的成员。



链接代码: []



Default.aspx



I am working asp.net vb project.. i m stuck with following error message.. please help me.
FindPageRankBtn_Click' is not a member of 'ASP.default_aspx.

Link code : WebSite3.zip - Google Drive[^]

Default.aspx

<form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Enter your url"

            style="top: 371px; left: 508px; position: absolute; height: 19px; width: 82px">
        </asp:Label><asp:TextBox ID="UrlText" runat="server"

            style="top: 366px; left: 609px; position: absolute; height: 23px; width: 208px">
        </asp:TextBox>
    </div>
    <p>
        &nbsp;</p>
    <p>
        <asp:Button ID="FindPageRankBtn" runat="server" Text="FindRank"

            onclick="FindPageRankBtn_Click"

            style="top: 362px; left: 842px; position: absolute; height: 26px; width: 83px" />
    </p>
    <asp:Label ID="ShowRank" runat="server"

       

        style="top: 431px; left: 612px; position: absolute; height: 19px; width: 300px"

        ForeColor="#FF3300" Font-Bold="True"></asp:Label>
    </form>







Default2.aspx.cs






Default2.aspx.cs

using System.Net;
using System.IO;
using System.Text.RegularExpressions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
 
public partial class GooglePageRenk : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void FindPageRankBtn_Click(object sender, EventArgs e)
    {
        GooglePR Gpr = new GooglePR();
        string Myurl = UrlText.Text;
        int googlePageRank = Gpr.MyPageRank(Myurl);
        ShowRank.Text =" Google page rank is: :-" + googlePageRank.ToString();
    }
 
    public class GooglePR
    {
        public GooglePR()
        {
 
        }
        private const UInt32 myConst = 0xE6359A60;
        private static void Hashing(ref UInt32 a, ref UInt32 b, ref UInt32 c)
        {
            a -= b; a -= c; a ^= c >> 13;
            b -= c; b -= a; b ^= a << 8;
            c -= a; c -= b; c ^= b >> 13;
            a -= b; a -= c; a ^= c >> 12;
            b -= c; b -= a; b ^= a << 16;
            c -= a; c -= b; c ^= b >> 5;
            a -= b; a -= c; a ^= c >> 3;
            b -= c; b -= a; b ^= a << 10;
            c -= a; c -= b; c ^= b >> 15;
        }
        public static string PerfectHash(string theURL)
        {
            string url = string.Format("info:{0}", theURL);
            int length = url.Length;
            UInt32 a, b;
            UInt32 c = myConst;
            int k = 0;
            int len = length;
            a = b = 0x9E3779B9;
            while (len >= 12)
            {
                a += (UInt32)(url[k + 0] + (url[k + 1] << 8) +
                     (url[k + 2] << 16) + (url[k + 3] << 24));
                b += (UInt32)(url[k + 4] + (url[k + 5] << 8) +
                     (url[k + 6] << 16) + (url[k + 7] << 24));
                c += (UInt32)(url[k + 8] + (url[k + 9] << 8) +
                     (url[k + 10] << 16) + (url[k + 11] << 24));
                Hashing(ref a, ref b, ref c);
                k += 12;
                len -= 12;
            }
            c += (UInt32)length;
            switch (len)
            {
                case 11:
                    c += (UInt32)(url[k + 10] << 24);
                    goto case 10;
                case 10:
                    c += (UInt32)(url[k + 9] << 16);
                    goto case 9;
                case 9:
                    c += (UInt32)(url[k + 8] << 8);
                    goto case 8;
                case 8:
                    b += (UInt32)(url[k + 7] << 24);
                    goto case 7;
                case 7:
                    b += (UInt32)(url[k + 6] << 16);
                    goto case 6;
                case 6:
                    b += (UInt32)(url[k + 5] << 8);
                    goto case 5;
                case 5:
                    b += (UInt32)(url[k + 4]);
                    goto case 4;
                case 4:
                    a += (UInt32)(url[k + 3] << 24);
                    goto case 3;
                case 3:
                    a += (UInt32)(url[k + 2] << 16);
                    goto case 2;
                case 2:
                    a += (UInt32)(url[k + 1] << 8);
                    goto case 1;
                case 1:
                    a += (UInt32)(url[k + 0]);
                    break;
                default:
                    break;
            }
            Hashing(ref a, ref b, ref c);
            return string.Format("6{0}", c);
        }
        public int MyPageRank(string MyUrl)
        {
            string HashDomain = PerfectHash(MyUrl);
            string RequestedURL = string.Format("http://toolbarqueries.google.com/" +
                   "tbr?client=navclient-auto&ch={0}&features=Rank&q=info:{1}",
                   HashDomain, MyUrl);
            try
            {
                HttpWebRequest HttpRequest = (HttpWebRequest)WebRequest.Create(RequestedURL);
                string GetResponse = new StreamReader(
                       HttpRequest.GetResponse().GetResponseStream()).ReadToEnd();
                if (GetResponse.Length == 0)
                    return 0;
                else
                    return int.Parse(Regex.Match(GetResponse,
                           "Rank_1:[0-9]:([0-9]+)").Groups[1].Value);
            }
            catch (Exception)
            {
                return -1;
            }
        }
    }
}
</pre>

推荐答案


这篇关于FindPageRankBtn_Click'不是'ASP.default_aspx的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 09:33