预览模式: 普通 | 列表

摩卡时光国际网络电台(全)

常用JS代码大全

事件源对象
event.srcElement.tagName
event.srcElement.type
捕获释放
event.srcElement.setCapture();  
event.srcElement.releaseCapture();  
事件按键
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
事件返回值
event.returnValue
鼠标位置
event.x
event.y
窗体活动元素
document.activeElement
绑定事件
document.captureEvents(Event.KEYDOWN);
访问窗体元素
document.all("txt").focus()...

查看更多...

分类:WEB设计 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 27
<input   name=Button   onClick=document.all.WebBrowser.ExecWB(1,1)   type=button   value=打开>  
<OBJECT   classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2   height=0   id=WebBrowser   width=0> </OBJECT>  
<input   name=Button &nb...

查看更多...

分类:WEB设计 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 56

20组免费的用户界面图标

这些图标作为web应用和移动应用UI设计,非常合适不过,别忘了,他们是免费的。


 

1. Iconza

 

查看更多...

分类:WEB设计 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 25

33个与众不同的Web表单设计

表单在web设计中很重要,因为它具有直接的用户交互。创新?有趣?富有色彩?设计一个交互,需要设计师关注登陆/注册表单的设计元素。

这里有33个与众不同的web表单设计,希望能使你获得设计灵感。

1. Buffalo – Proposal Planner

 

 

2. We love icons

 

 

3. TinyBas

 

查看更多...

Tags: Web 设计 表单

分类:WEB设计 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5

删除记录时显示提示窗口

onClick='Javascript:return confirm("Are you sure you want to delete?");'

查看更多...

分类:WEB设计 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 0

纯CSS无图片带箭头的DIV方框

[代码] [CSS]代码

01 <html>
02 <head>
03 <title>纯CSS无图片带箭头的DIV方框</title>
04 <style>
05 div.container{position:absolute;
06 top:30px;
07 left:40px;
08 font-size: 9pt;
09 display:block;
10 height:100px;
11 width:200px;
12 background-color:transparent;
13 *border:1px solid #666;
14 }
15 s{
16 position:absolute;
17 top:-20px;
18 *top:-22px;
19 left:20px;
20 display:block;
21 height:0;
22 width:0;
23 font-size: 0
24 line-height: 0;
25 border-color:transparent transparent #666 transparent;
26 border-style:dashed dashed solid dashed;
27 border-width:10px;
28 }
29 i{position:absolute;
30 top:-9px;
31 *top:-9px;
32 left:-10px;
33 display:block;
34 height:0;
35 width:0;
36 font-size: 0;
37 line-height: 0;
38 border-color:transparent transparent #fff transparent;
39 border-style:dashed dashed solid dashed;
40 border-width:10px;
41 }
42 .content{
43 border:1px solid #666;
44 -moz-border-radius:3px;
45 -webkit-border-radius:3px;
46 position:absolute;
47 background-color:#fff;
48 width:100%;
49 height:100%;
50 padding:5px;
51 *top:-2px;
52 *border-top:1px solid #666;
53 *border-top:1px solid #666;
54 *border-left:none;
55 *border-right:none;
56 *height:102px;
57 box-shadow: 3px 3px 4px #999;
58 -moz-box-shadow: 3px 3px 4px #999;
59 -webkit-box-shadow: 3px 3px 4px #999;
60 /* For IE 5.5 - 7 */
61 filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#999999');
62 /* For IE 8 */
63 -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#999999')"
64 }
65 </style>
66 </head>
67 <body>
68 <div class="container">
69 <div class="content"><br>这是框中的文字,可动态显示。高度自动增加,应该不错吧^_^</div>
70 <s>
71 <i></i>
72 </s>
73 </div>
74 <br />
75 </body>
76 </html>
 

 

分类:WEB设计 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 47

[文件] SQLHelper.zip ~ 3KB    下载

[代码] [C#]代码

01 /// <summary>
02 /// 用于非select查询,内置事务支持。
03 /// </summary>
04 /// <param name="commandText">要执行的参数化查询语句。</param>
05 /// <param name="parameters">
06 ///     参数的可变数组。
07 ///     <para>如果是命名参数,形式应该为"name=value"。</para>
08 ///     <para>如果是位置参数,形式应该为value,并且与参数化语句中的参数顺序一一对应。</para>
09 ///     <para>name为命名参数的名字,value为参数的值。</para>
10 /// </param>
11 /// <returns>如果受影响的行不大于0或发生异常,返回null。</returns>
12 public int? Exec(String commandText,params Object[] parameters) {
13     int? rowAffected = null;
14   
15     if(null != this.Conn && this.Conn.State == ConnectionState.Open) {
16         rowAffected = this.Execute(this.Conn,commandText,parameters);
17     }
18     else {
19         using(IDbConnection conn = this.factory.CreateConnection()) {
20             conn.ConnectionString = this.connSetting.ConnectionString;
21   
22             IDbCommand comm = conn.CreateCommand();
23             comm.CommandText = commandText;
24             comm.CommandType = CommandType.Text;
25             if(null != parameters && parameters.Length > 0) {
26                 ReturnValue rv = this.HandleParameters(ref comm,parameters);
27                 if(ReturnType.Success != rv.Type) {
28                     System.Diagnostics.Debug.WriteLine(rv.Message);
29                     return null;
30                 }
31             }
32   
33             //执行查询
34             try {
35                 conn.Open();
36                 using(IDbTransaction trans = conn.BeginTransaction()) {
37                     rowAffected = comm.ExecuteNonQuery();
38   
39                     trans.Commit();
40                 }
41             }
42             catch(DbException e) {
43                 System.Diagnostics.Debug.WriteLine("# SQLHelper : 查询数据库时发生异常 : " + e.Message);
44                 return null;
45             }
46         }
47     }
48   
49     return rowAffected > 0 ? rowAffected : null;
50 }

[代码] [C#]代码

01 DataTable GetDataTable(IDbConnection conn,String commandText,Object[] parameters) {
02     IDbCommand comm = conn.CreateCommand();
03     comm.CommandText = commandText;
04     comm.CommandType = CommandType.Text;
05     if(null != parameters && parameters.Length > 0) {
06         ReturnValue rv = this.HandleParameters(ref comm,parameters);
07         if(ReturnType.Success != rv.Type) {
08             System.Diagnostics.Debug.WriteLine(rv.Message);
09             return null;
10         }
11     }
12   
13     //执行查询
14     try {
15         if(conn.State != ConnectionState.Open) {
16             conn.Open();
17         }
18         DataTable dt = new DataTable();
19         using(IDataReader reader = comm.ExecuteReader()) {
20             dt.Load(reader);
21         }
22         return dt;
23     }
24     catch(DbException e) {
25         System.Diagnostics.Debug.WriteLine("# SQLHelper : 查询数据库时发生异常 : " + e.Message);
26         return null;
27     }
28 }

[代码] [C#]代码

01 /// <summary>
02 /// 处理查询命令的参数。
03 /// </summary>
04 ReturnValue HandleParameters(ref IDbCommand comm,Object[] parameters) {
05     IDbDataParameter dbParam;
06     String param;
07     String paramName;
08     String paramValue;
09   
10     try {
11         foreach(Object p in parameters) {
12             param = p as String;
13             dbParam = comm.CreateParameter();
14             if(!String.IsNullOrEmpty(param) && param.Contains("=")) {
15                 paramName = param.Split('=')[0];
16                 paramValue = param.Split('=')[1];
17   
18                 dbParam.ParameterName = paramName;
19                 dbParam.Value = paramValue;
20   
21                 comm.Parameters.Add(dbParam);
22             }
23             else {
24                 dbParam.Value = p;
25   
26                 comm.Parameters.Add(dbParam);
27             }
28         }
29     }
30     catch(Exception e) {
31         return new ReturnValue { Message = "# SQLHelper : 处理参数时发生异常 : " + e.Message,Type = ReturnType.Exception };
32     }
33   
34     return new ReturnValue();
35 }
分类:程序乐园 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 22

C#根据用户IP地址查询用户信息

调用接口来自sina,显示的信息较为全面。
接口地址为  http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip={ip}
返回json,格式为如下
{"ret":1,"start":"59.174.77.0","end":"59.174.80.156","country":"\u4e2d\u56fd",
"province":"\u6e56\u5317","city":"\u6b66\u6c49","district&am...

查看更多...

分类:程序乐园 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 35