最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C#編程實(shí)現(xiàn)QQ界面的方法

 更新時(shí)間:2016年03月03日 10:16:48   作者:Microblue  
這篇文章主要介紹了C#編程實(shí)現(xiàn)QQ界面的方法,較為詳細(xì)的分析了C#實(shí)現(xiàn)模擬QQ登錄界面的具體步驟與相關(guān)實(shí)現(xiàn)代碼,需要的朋友可以參考下

本文實(shí)例講述了C#編程實(shí)現(xiàn)QQ界面的方法。分享給大家供大家參考,具體如下:

步驟:

1.新建一個(gè)頁面,假如說叫VerticalMenu

2.把html代碼copy到html代碼區(qū)

3.把LoadTopMenu方法copy到cs代碼區(qū)

4.運(yùn)行即可

1.html代碼

<STYLE type="text/css">
  A:link {}{ COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none}
  A:visited {}{ COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none}
  A:hover {}{ COLOR: #006CD9; FONT-SIZE: 12px; TEXT-DECORATION: none}
  BODY {}{ FONT-SIZE: 12px;}
  TD {}{ FONT-SIZE: 12px; line-height: 150%}
</STYLE>
<script language="JavaScript">
<!--
function showitem(id,name)
{
  //打開彈出式頁面
  //return ("<span><a href='"+id+"' target=_blank>"+name+"</a></span><br>")
  //在框架中打開
  return ("<span><a href='#' onclick=/"url('"+id+"');/">"+name+"</a></span><br>")
}
function url(id)
{
  var source = document.getElementById('fMain');
  source.src=id;
}
function switchoutlookBar(number)
{
  var i = outlookbar.opentitle;
  outlookbar.opentitle=number;
  var id1,id2,id1b,id2b
  if (number!=i && outlooksmoothstat==0){
    if (number!=-1)
    {
      if (i==-1){
        id2="blankdiv";
        id2b="blankdiv";
      }
      else{
        id2="outlookdiv"+i;
        id2b="outlookdivin"+i;
        document.all("outlooktitle"+i).style.border="1px none navy";
        document.all("outlooktitle"+i).style.background=outlookbar.maincolor;
        document.all("outlooktitle"+i).style.color="#ffffff";
        document.all("outlooktitle"+i).style.textalign="center";
      }
      id1="outlookdiv"+number
      id1b="outlookdivin"+number
      document.all("outlooktitle"+number).style.border="1px none white";
      document.all("outlooktitle"+number).style.background=outlookbar.maincolor; //title
      document.all("outlooktitle"+number).style.color="#ffffff";
      document.all("outlooktitle"+number).style.textalign="center";
      smoothout(id1,id2,id1b,id2b,0);
    }
    else
    {
      document.all("blankdiv").style.display="";
      document.all("blankdiv").sryle.height="100%";
      document.all("outlookdiv"+i).style.display="none";
      document.all("outlookdiv"+i).style.height="0%";
      document.all("outlooktitle"+i).style.border="1px none navy";
      document.all("outlooktitle"+i).style.background=outlookbar.maincolor;
      document.all("outlooktitle"+i).style.color="#ffffff";
      document.all("outlooktitle"+i).style.textalign="center";
    }
  }
}
function smoothout(id1,id2,id1b,id2b,stat)
{
  if(stat==0){
    tempinnertext1=document.all(id1b).innerHTML;
    tempinnertext2=document.all(id2b).innerHTML;
    document.all(id1b).innerHTML="";
    document.all(id2b).innerHTML="";
    outlooksmoothstat=1;
    document.all(id1b).style.overflow="hidden";
    document.all(id2b).style.overflow="hidden";
    document.all(id1).style.height="0%";
    document.all(id1).style.display="";
    setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+outlookbar.inc+")",outlookbar.timedalay);
  }
  else
  {
    stat+=outlookbar.inc;
    if (stat>100)
      stat=100;
    document.all(id1).style.height=stat+"%";
    document.all(id2).style.height=(100-stat)+"%";
    if (stat<100) 
      setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+stat+")",outlookbar.timedalay);
    else
    {
      document.all(id1b).innerHTML=tempinnertext1;
      document.all(id2b).innerHTML=tempinnertext2;
      outlooksmoothstat=0;
      document.all(id1b).style.overflow="auto";
      document.all(id2).style.display="none";
    }
  }
}
function getOutLine()
{
  outline="<table "+outlookbar.otherclass+">";
  for (i=0;i<(outlookbar.titlelist.length);i++)
  {
    outline+="<tr><td name=outlooktitle"+i+" id=outlooktitle"+i+" "; 
    if (i!=outlookbar.opentitle) 
      outline+=" nowrap align=center style='cursor:hand;background-color:"+outlookbar.maincolor+";color:#ffffff;height:20;border:1 none navy' ";
    else
      outline+=" nowrap align=center style='cursor:hand;background-color:"+outlookbar.maincolor+";color:white;height:20;border:1 none white' ";
    outline+=outlookbar.titlelist[i].otherclass
    outline+=" onclick='switchoutlookBar("+i+")'><span class=smallFont>";
    outline+=outlookbar.titlelist[i].title+"</span></td></tr>";
    outline+="<tr><td name=outlookdiv"+i+" valign=top align=center id=outlookdiv"+i+" style='width:100%"
    if (i!=outlookbar.opentitle) 
      outline+=";display:none;height:0%;";
    else
      outline+=";display:;height:100%;";
    outline+="'><div name=outlookdivin"+i+" id=outlookdivin"+i+" style='overflow:auto;width:100%;height:100%'>";
    for (j=0;j<outlookbar.itemlist[i].length;j++)
      outline+=showitem(outlookbar.itemlist[i][j].key,outlookbar.itemlist[i][j].title);
    outline+="</div></td></tr>"
  }
  outline+="</table>"
  return outline
}
function show()
{
  var outline;
  outline="<div id=outLookBarDiv name=outLookBarDiv style='width=100%;height:100%'>"
  outline+=outlookbar.getOutLine();
  outline+="</div>"
  document.write(outline);
}
function theitem(intitle,instate,inkey)
{
  this.state=instate;
  this.otherclass=" nowrap ";
  this.key=inkey;
  this.title=intitle;
}
function addtitle(intitle)
{
  outlookbar.itemlist[outlookbar.titlelist.length]=new Array();
  outlookbar.titlelist[outlookbar.titlelist.length]=new theitem(intitle,1,0);
  return(outlookbar.titlelist.length-1);
}
function additem(intitle,parentid,inkey)
{
  if (parentid>=0 && parentid<=outlookbar.titlelist.length)
  {
    outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length]=new theitem(intitle,2,inkey);
    outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length-1].otherclass=" nowrap align=left style='height:5' ";
    return(outlookbar.itemlist[parentid].length-1);
  }
  else
    additem=-1;
}
function outlook()
{
  this.titlelist=new Array();
  this.itemlist=new Array();
  this.divstyle="style='height:100%;width:100%;overflow:auto' align=center";//可以在這里設(shè)置對(duì)齊方式
  this.otherclass="border=0 cellspacing='0' cellpadding='0' style='height:100%;width:100%'valign=middle align=center ";
  this.addtitle=addtitle;
  this.additem=additem;
  this.starttitle=-1;
  this.show=show;
  this.getOutLine=getOutLine;
  this.opentitle=this.starttitle;
  this.reflesh=outreflesh;
  this.timedelay=50;
  this.inc=10;
  this.maincolor = "#336699"
}
function outreflesh()
{
  document.all("outLookBarDiv").innerHTML=outlookbar.getOutLine();
}
function locatefold(foldname)
{
  if (foldname=="")
    foldname = outlookbar.titlelist[0].title
  for (var i=0;i<outlookbar.titlelist.length;i++)
  {
    if(foldname==outlookbar.titlelist[i].title)
    {
      outlookbar.starttitle=i;
      outlookbar.opentitle=i;
    }
  }
}
var outlookbar=new outlook();
var tempinnertext1,tempinnertext2,outlooksmoothstat
outlooksmoothstat = 0;
<%=LoadVerticalMenu()%>//從數(shù)據(jù)庫產(chǎn)生垂直菜單
//-->
</script>
<table id="mnuList" style="WIDTH:150px;HEIGHT: 100%" cellspacing="0" cellpadding="0" align="left"
  border="0">
  <tr>
    <td bgcolor="#F0F0E5" id="outLookBarShow" style="HEIGHT: 100%" valign="top" align="middle"
      name="outLookBarShow">
      <script language="JavaScript">
      <!--
      locatefold("")
      outlookbar.show() 
      //-->
      </script>
    </td>
  </tr>
</table>

2.cs代碼

public class VerticalMenu : System.Web.UI.Page
{
  protected DataRow[] father;
  protected DataRow[] first;
    private void Page_Load(object sender, System.EventArgs e)
    {
      // 模擬QQ菜單
    }
  public static string ConnectionString=System.Configuration .ConfigurationSettings .AppSettings["ConnectionString"];
  
    GetDataSet#region GetDataSet
    public static DataSet GetDataSet(string sql)
    {
      SqlDataAdapter  sda =new SqlDataAdapter(sql,ConnectionString);
      DataSet ds=new DataSet();
      sda.Fill(ds);
      return ds;
    }
    #endregion
  protected string LoadVerticalMenu()
  {
  string sqlFather="select * from PowerSetting";
  DataSet dsFather=GetDataSet(sqlFather);
  father=dsFather.Tables[0].Select("IsBoot=0","IsBoot");
  string menu="";
  foreach(DataRow drfather in father)
  {
    menu+="var t;";
    menu+="t=outlookbar.addtitle('"+drfather["Description"]+"');";
    first=dsFather.Tables[0].Select("ParentID='"+Convert.ToInt32(drfather["ParentID"])+"' and IsBoot=1","IsBoot");
    foreach(DataRow drfirst in first)
    {
      menu+="outlookbar.additem('"+drfirst["Description"]+"',t,'"+drfirst["Url"]+"');";
    }
  }
  return menu;
  }
    Web Form Designer generated code#region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
      //
      // CODEGEN: This call is required by the ASP.NET Web Form Designer.
      //
      InitializeComponent();
      base.OnInit(e);
    }
    /**//**//**//// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.Load += new System.EventHandler(this.Page_Load);
    }
    #endregion
}

3.數(shù)據(jù)庫腳本

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PowerSetting]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PowerSetting]
GO
CREATE TABLE [dbo].[PowerSetting] (
  [PowerSettingID] [int] IDENTITY (1, 1) NOT NULL ,      --id
  [ParentID] [int] NOT NULL ,            --父節(jié)點(diǎn)id
  [Description] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,  --菜單描述內(nèi)容
  [Icon] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,    --要顯示圖標(biāo)
  [Url] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,    --url
  [Target] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,    --_self,_blank等
  [CreateByID] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,  --創(chuàng)建人id
  [CreateON] [datetime] NULL ,          --創(chuàng)建日期
  [IsEnabled] [bit] NULL ,            --是否可用
  [IsBoot] [int] NULL             --是不是根節(jié)點(diǎn);1是其他不是
) ON [PRIMARY]
GO

更多關(guān)于C#相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《C#數(shù)據(jù)結(jié)構(gòu)與算法教程》、《C#常見控件用法教程》、《C#面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》及《C#程序設(shè)計(jì)之線程使用技巧總結(jié)

希望本文所述對(duì)大家C#程序設(shè)計(jì)有所幫助。

相關(guān)文章

  • C#使用Stack類進(jìn)行堆棧設(shè)計(jì)詳解

    C#使用Stack類進(jìn)行堆棧設(shè)計(jì)詳解

    C#中的堆棧由System.Collections.Generic命名空間中的Stack類定義,那么下面就跟隨小編一起學(xué)習(xí)一下C#如何Stack類進(jìn)行堆棧設(shè)計(jì)吧
    2024-03-03
  • C#波形圖控件制作示例程序

    C#波形圖控件制作示例程序

    這篇文章主要介紹了C#波形圖控件的制作方法,大家參考使用
    2013-11-11
  • C#中yield用法使用說明

    C#中yield用法使用說明

    本文介紹了C#中yield的使用方法,yield 語句不能出現(xiàn)在匿名方法,其他相關(guān)內(nèi)容就仔細(xì)閱讀下文吧
    2015-10-10
  • C#如何連接使用Zookeeper

    C#如何連接使用Zookeeper

    Zookeeper作為分布式的服務(wù)框架,雖然是java寫的,但是強(qiáng)大的C#也可以連接使用。而現(xiàn)在主要有兩個(gè)插件可供使用,分別是ZooKeeperNetEx和Zookeeper.Net,個(gè)人推薦使用ZooKeeperNetEx做開發(fā),本文也已介紹ZooKeeperNetEx為主
    2021-06-06
  • C#實(shí)現(xiàn)根據(jù)圖片的鏈接地址獲取圖片的后綴名

    C#實(shí)現(xiàn)根據(jù)圖片的鏈接地址獲取圖片的后綴名

    這篇文章主要為大家詳細(xì)介紹了C#如何實(shí)現(xiàn)根據(jù)圖片的鏈接地址獲取圖片的后綴名,文中的實(shí)現(xiàn)方法講解詳細(xì),感興趣的小伙伴可以跟隨小編一起了解一下
    2023-02-02
  • C# 判斷字符為空的6種方法的效率實(shí)測對(duì)比

    C# 判斷字符為空的6種方法的效率實(shí)測對(duì)比

    本文主要介紹了C#中判斷字符是否為空的方法,并實(shí)測對(duì)比各種方法的執(zhí)行效率,最后推薦大家使用IsNullOrEmpty,效率和易用性比較均衡。
    2016-05-05
  • C#動(dòng)態(tài)生成DropDownList執(zhí)行失敗原因分析

    C#動(dòng)態(tài)生成DropDownList執(zhí)行失敗原因分析

    這篇文章主要介紹了C#動(dòng)態(tài)生成DropDownList執(zhí)行失敗原因分析,以一個(gè)實(shí)例形式分析了C#動(dòng)態(tài)生成DropDownList的相關(guān)注意要點(diǎn)與使用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2015-03-03
  • C#讀取本地網(wǎng)絡(luò)配置信息全攻略分享

    C#讀取本地網(wǎng)絡(luò)配置信息全攻略分享

    在當(dāng)今數(shù)字化時(shí)代,網(wǎng)絡(luò)已深度融入我們生活與工作的方方面面,對(duì)于軟件開發(fā)而言,掌握本地計(jì)算機(jī)的網(wǎng)絡(luò)配置信息顯得尤為關(guān)鍵,而在 C# 編程的世界里,我們又該如何巧妙地讀取這些至關(guān)重要的本地網(wǎng)絡(luò)配置信息呢?接下來,就讓我們一同踏上探索之旅
    2025-01-01
  • 詳解Asp.Net MVC的Bundle捆綁

    詳解Asp.Net MVC的Bundle捆綁

    這篇文章主要介紹了Asp.Net MVC的Bundle捆綁方法,具體實(shí)現(xiàn)方法給大家做代碼整理,一起參考一下。
    2017-11-11
  • Unity UGUI的ToggleGroup選項(xiàng)組件介紹使用

    Unity UGUI的ToggleGroup選項(xiàng)組件介紹使用

    這篇文章主要為大家介紹了Unity UGUI的ToggleGroup選項(xiàng)組件介紹使用示例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-07-07

最新評(píng)論

志丹县| 山阴县| 东港市| 扶余县| 房产| 买车| 兴业县| 怀集县| 六安市| 杭州市| 上林县| 东丰县| 黄龙县| 苗栗县| 乐山市| 合阳县| 萝北县| 水城县| 万宁市| 廊坊市| 商水县| 梁河县| 孝义市| 武清区| 广昌县| 三穗县| 阿拉善左旗| 蓝山县| 遵化市| 平潭县| 上蔡县| 宝山区| 双柏县| 鄱阳县| 孝义市| 贵港市| 江北区| 辉县市| 托里县| 天水市| 罗平县|