国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
添加表情的代碼

先在網(wǎng)上找到附件中的素材和部分源碼,在稍加改造即可應(yīng)用于評(píng)論框或者留言框旁邊

 

 

下面代碼和網(wǎng)上下載的素材是不一樣的,素材中的是html控件,而下面則改成了服務(wù)器控件(為了能在后臺(tái)獲取文本框的值),先上代碼,改動(dòng)說明下面再說:

Html代碼
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="common_test2" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4. <!--   
  5.     創(chuàng)建時(shí)間:08/25/2010 22:07:24   
  6.     說明:   
  7. -->  
  8. <html xmlns="http://www.w3.org/1999/xhtml" >  
  9. <head runat="server">  
  10.     <title>無標(biāo)題頁</title>  
  11. </head>  
  12. <body>  
  13.     <form id="form1" runat="server">  
  14.   
  15.   
  16. <div class="team_l">  
  17. <asp:TextBox ID="txtname" runat="server" Height="106px" TextMode="MultiLine"  
  18.         Width="182px" onkeydown=gbcount(this.form.gb_word,this.form.total,this.form.used,this.form.remain); onkeyup=gbcount(this.form.gb_word,this.form.total,this.form.used,this.form.remain);></asp:TextBox>  
  19. <br />  
  20. <div class="team_r" style="width:380px">  
  21.   <p><img src="../images/1.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[-_-] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  22.       <img src="../images/2.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[@o@] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  23.       <img src="../images/3.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[-|-] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  24.       <img src="../images/4.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[o_o] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  25.       <img src="../images/5.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[ToT] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  26.       <img src="../images/6.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[*_*] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  27.       <img src="../images/7.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[-x-] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  28.       <img src="../images/8.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[-_-zz] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  29.       <img src="../images/9.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[t_t] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  30.       <img src="../images/10.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[-_-!] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  31.       <img src="../images/11.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:,] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  32.       <img src="../images/12.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:P] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  33.       <img src="../images/13.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:D] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  34.       <img src="../images/14.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:)] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  35.       <img src="../images/15.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:(] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  36.       <img src="../images/16.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:O] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  37.       <img src="../images/17.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:#] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  38.       <img src="../images/18.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:Z] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  39.       <img src="../images/19.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:0=] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  40.       <img src="../images/20.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/:P] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  41.       <img src="../images/21.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:$] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  42.       <img src="../images/22.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[-.-] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  43.       <img src="../images/23.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/-_-] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  44.       <img src="../images/24.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:{] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  45.       <img src="../images/25.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[zz] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  46.       <img src="../images/26.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[|-_-|] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  47.       <img src="../images/27.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[-_-||] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  48.       <img src="../images/28.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:.] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  49.       <img src="../images/29.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:-Q] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  50.       <img src="../images/30.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[9_9] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  51.       <img src="../images/31.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:,.] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  52.       <img src="../images/32.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:?] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  53.       <img src="../images/33.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:-|] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  54.       <img src="../images/34.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:K] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  55.       <img src="../images/35.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:G] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  56.       <img src="../images/36.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:L] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  57.       <img src="../images/37.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:c] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  58.       <img src="../images/38.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:q] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  59.       <img src="../images/39.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[:Y] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  60.       <img src="../images/40.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/gs] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  61.       <img src="../images/41.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/sg] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  62.       <img src="../images/42.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/hp] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  63.       <img src="../images/43.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/ok] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  64.       <img src="../images/44.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/rain] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  65.       <img src="../images/45.gif" width="20" height="20" onClick="document.getElementById('txtname').value+='[/yin] ';document.getElementById('txtname').focus()" style="cursor:hand">  
  66.     </p>  
  67. </div>  
  68. <input type="reset" name="Submit2" value="重置">  
  69.     <asp:Button ID="submit" runat="server" Text="提交" OnClick="submit_Click" /><img src='../images/23.gif' width='20' height='20'/>  
  70. </div>  
  71. </form>  
  72. </body>  
  73. </html>  

原素材是獲取name,而服務(wù)器控件沒有name,故我們改成獲取id

即將onClick="document.forms[0].gb_word.value(這句看不懂沒有關(guān)系,是素材中的)改成

Html代碼
  1. onClick="document.getElementById('txtname').value  

注:txtname為文本框的id值

 

這樣就能在.cs文件中能取得文本框的值,從而添加到數(shù)據(jù)庫中

 

注:服務(wù)器控件的id轉(zhuǎn)成html的id后是一段很長(zhǎng)的字符串,如果上面改動(dòng)不能用,就把txtname改成對(duì)應(yīng)生成的html頁面的id即可

 

到此為止,展示頁面的代碼就改完了,接下來在后面進(jìn)行處理,主要用到了replace(用法在網(wǎng)上搜一下就知道了,非常好用的)函數(shù)。

 

符號(hào)裝成圖片的方法

C#代碼
  1. public string PictureSwap(string str)   
  2.    {   
  3.        string[] a = new string[] { "[-_-]""[@o@]""[-|-]""[o_o]""[ToT]""[*_*]""[-x-]""[-_-zz]""[t_t]""[-_-!]""[:,]""[:P]""[:D]""[:)]""[:(]""[:O]""[:#]""[:Z]""[:0=]""[/:P]""[:$]""[-.-]""[/-_-]""[:{]""[zz]""[|-_-|]""[-_-||]""[:.]""[:-Q]""[9_9]""[:,.]""[:?]""[:-|]""[:K]""[:G]""[:L]""[:c]""[:q]""[:Y]""[/gs]""[/sg]""[/hp]""[/ok]""[/rain]""[/yin]" };   
  4.        for (int i = 1; i <= 45; i++)   
  5.        {   
  6.            str = str.Replace(a[i - 1], "<img src='../images/" + i + ".gif' width='20' height='20'/>");   
  7.              
  8.        }   
  9.        Response.Write(str + "asadadadad<br/>");   
  10.        return str;   
  11.    }  

 參數(shù)str為要要轉(zhuǎn)換的文字,比如說是整個(gè)留言的內(nèi)容(其中加有類似([-|-])的符號(hào))

 

用到了數(shù)組跟循環(huán),也不太難就不說了

 

調(diào)用方法

Java代碼
  1. string s = PictureSwap(txtname.Text.toString());  
 

s即為轉(zhuǎn)換后的能顯示圖片的字符串

 

顯示時(shí)有兩種處理方式:

1.在存入數(shù)據(jù)庫之前調(diào)用PictureSwap改變成圖片地址

2、取出數(shù)據(jù)時(shí)調(diào)用PictureSwap轉(zhuǎn)換成圖片顯示

 

這就看個(gè)人愛好,也看是哪一個(gè)使用頻繁咯。

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
js獲取圖片的原始尺寸
在ecshop首頁增加對(duì)聯(lián)廣告的方法
收藏一些有用的JS代碼
QQ 代碼
QQ空間背景制作
Javascript實(shí)例練習(xí)——初級(jí)適用
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服