09 Feb 2004

分页存储过程

搞了一中午终于可以用了 但不知道效率如何.郁闷的是我要用php去调用它

  /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    CopyRight:   ******
    CreateData:   2004-02-09
    Language:   MS SQL SERVER 存储过程
    AuthorName:  Meibo Wu

    实现功能:   分页显示当用户选择了图片大分类时(按手机)的数据
    参数说明:   @bigtype为大分类
    @gid为传入的图片类型           
        $PageSize为每页显示的记录数量
    @pageindex为当前页码                             
    LastUpdate:            
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
CREATE procedure sms_img_page_no_smalltype
(
 @bigtype nvarchar(20),
 @gid int,
 @pagesize int,
 @pageindex int
)
as
set nocount on
 declare @LikeBigType nvarchar(20)
 declare @PageLowerBound int
 declare @PageUpperBound int
 declare @indextable table(id int identity(1,1),nid int)
  set @PageLowerBound=(@pageindex-1)*@pagesize
  set @PageUpperBound= @PageLowerBound+@pagesize
  set @LikeBigType= @bigtype+'%'
  set rowcount @PageUpperBound
 insert into @indextable(nid)
  select  a.col_id
   from web_sms_data_img as a join web_sms_data_mobile as q
   on a.col_mobile_type=q.col_mobile_type
   where
a.col_img_group=@gid
    and q.col_mobile_comment  like @LikeBigType
   order by a.col_id desc 
 /*
 select  @LikeBigType
 select * from @indextable 
 */
 select q.col_mobile_comment,
  a.col_id,
  a.col_img_hits,
  a.col_img_dir,
  a.col_img_name
  from web_sms_data_img as a join web_sms_data_mobile as q
   on a.col_mobile_type=q.col_mobile_type
    join @indextable  as p
    on a.col_id=p.nid
  where p.id>@PageLowerBound and p.id<
=@PageUpperBound
   and
a.col_img_group=@gid
   and q.col_mobile_comment like @LikeBigType
 
 order by p.id

set nocount off
GO

09 Feb 2004

顺便发现一bug??

在这个http://www.cnblogs.com/huobazi/archive/2004/02/09/1053.aspx 里有一句
a.col_img_group=@gid

被DotText当成mailto 自动加上了mailto连接

04 Feb 2004

使网页中的元素可编辑

net_lover的文章里找到了答案.

http://www.csdn.net/Develop/Read_Article.asp?Id=4405


代码如下:
<HTML>
<HEAD>
</HEAD>
<BODY>
<DIV ID=“oDiv”>TEST—TEST—TEST 您可以在这里编辑文字!</DIV>
<SCRIPT>
<!–
oDiv.contentEditable = true;
// –>
</SCRIPT>
</BODY>
</HTML>

04 Feb 2004

域名Whois信息查询(ASP.NET+C#)

去年写的了,是从点缀的博客学来的
看演示请点这里:http://www.github.com/whois.aspx
代码如下:
<% @Page Language="C#" %>
<% @Import Namespace="System.Net.Sockets" %>
<% @Import Namespace="System.Text" %>
<% @Import Namespace="System.IO" %>
<html>
<head>
<title>.Com/.Net/.Org/.Cn 域名Whois信息查询</title>
<meta name="keywords" content=".Com,.Net,.Org,.Cn 域名Whois信息查询">
<meta name="generator" content=".Com/.Net/.Org,.Cn 域名Whois信息查询">
<meta name="description" content=".Com/.Net/.Org,.Cn 域名Whois信息查询">
<style>
<!--
body,input{
        font-family: Tahoma, Verdana; color: #004080; font-size: 12px        
        }
a:link,a:visited{
        text-decoration: none; color: #004080
        }
-->
</style>
</head>
<body>
<form id="fmQuery" runat="server">
&nbsp;要查询的域名域名:
www.<asp:TextBox id="txtDomain" width="100" value="ASPXBOY.COM" runat="server" />
&nbsp; <asp:Button id="btnQuery" OnClick="btn_click"
text="查询!" runat="server" />(只能查询.Com/.Net/.Org/.Cn 域名Whois的信息)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href ="WhoisCode.htm" title="View the source code here!">源代码在这里</a>
<BR><HR width="550" height="1" align="left"><BR>
<asp:label id="lblResult" runat="server" />
</form>
</body>
</html>
<script language="C#" runat="server">
void btn_click(Object sender, EventArgs e)
{
String strServer;
String strDomain = txtDomain.Text;
String strServerCom = "whois.networksolutions.com";
String strServerCN = "whois.cnnic.net.cn";
String strResponse;
string[] arrDomain = strDomain.Split('.');
if (arrDomain[1].ToUpper()=="CN")
{
       
        strServer=strServerCN;
}
else
{
        strServer=strServerCom;
}

bool blSuccess = IsWhosisSuccess(strDomain, strServer, out strResponse);
if (blSuccess)
{
lblResult.Text = strResponse;
}
else
{
lblResult.Text = "查找失败....";
}
}
bool IsWhosisSuccess(String strDomain, String strServer,
                   out String strResponse)
{
  strResponse = "none";
  bool blSuccess = false;
  TcpClient tcpc = new TcpClient();
  try
  {
    tcpc.Connect(strServer, 43);
  }
  catch(SocketException ex)
  {
    strResponse = "连接不到该 Whois server,请稍后再试。";
    return false;
  }

  strDomain += "\r\n";
  Byte[] arrDomain = Encoding.UTF8.GetBytes(strDomain.ToCharArray());
  try
  {
        Stream s = tcpc.GetStream();
        s.Write(arrDomain, 0, strDomain.Length);
       
        StreamReader sr = new StreamReader(tcpc.GetStream(), Encoding.UTF8);
        StringBuilder strBuilder = new StringBuilder();
        string strLine = null;

        while (null != (strLine = sr.ReadLine()))
        {
                strBuilder.Append(strLine+"<br>");
        }
        tcpc.Close();
               
        blSuccess = true;
        string my="Go to Huobazi's WebSite:<a href=\"http://www.github.com\" title=\".Net男孩社区\">www.github.Com</a><br>";
        strResponse = strBuilder.ToString()+my;  }
  catch(Exception e)
  {
        strResponse = e.ToString();
  }
  
  return blSuccess;
}
  </script>

03 Feb 2004

又开始吵架了


http://expert.csdn.net/Expert/topic/2697/2697501.xml?temp=.2264826

不过没有这个帖子吵的凶哦

29 Jan 2004

Hello World !

 Hello World !
开张了
 Hello World !
开张了
 Hello World !
开张了

29 Jan 2004

MSN Toolbar 谁用了

MSN Toolbar Beta