asp.net µ÷Óô洢¹ý³Ì
1.»ñÈ¡Return·µ»ØÖµ
³ÌÐò´úÂë//´æ´¢¹ý³Ì
//Create PROCEDURE MYSQL
// @a int,
// @b int
//AS
// return @a + @b
//GO
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToString());
conn.Open();
SqlCommand MyCommand = new SqlCommand("MYSQL", conn);
MyCommand.CommandType = CommandType.StoredProcedure;
MyCommand.Parameters.Add(new SqlParameter("@a", SqlDbType.Int));
MyCommand.Parameters["@a"].Value = 10;
MyCommand.Parameters.Add(new SqlParameter("@b", SqlDbType.Int));
MyCommand.Parameters["@b"].Value = 20;
MyCommand.Parameters.Add(new SqlParameter("@return", SqlDbType.Int));
MyCommand.Parameters["@return"].Direction = ParameterDirection.ReturnValue;
MyCommand.ExecuteNonQuery();
Response.Write(MyCommand.Parameters["@return"].Value.ToString());
2.»ñÈ¡OutputÊä³ö²ÎÊýÖµ
³ÌÐò´úÂë//´æ´¢¹ý³Ì
//Create PROCEDURE MYSQL
// @a int,
// @b int,
// @c int output
//AS
// Set @c = @a + @b
//GO
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToString());
conn.Open();
SqlCommand MyCommand = new SqlCommand("MYSQL", conn);
MyCommand.CommandType = CommandType.StoredProcedure;
MyCommand.Parameters.Add(new SqlParameter("@a", SqlDbType.Int));
MyCommand.Parameters["@a"].Value = 20;
MyCommand.Parameters.Add(new SqlParameter("@b", SqlDbType.Int));
MyCommand.Parameters["@b"].Value = 20;
MyCommand.Parameters.Add(new SqlParameter("@c", SqlDbType.Int));
MyCommand.Parameters["@c"].Direction = ParameterDirection.Output;
MyCommand.ExecuteNonQuery();
Response.Write(MyCommand.Parameters["@c"].Value.ToString());
Ïà¹ØÎĵµ£º
³£Óú¯ÊýϵÁÐ:
public static string Get_ClientIP() µÃµ½¿Í»§¶ËIP
public static string Get_CMac(string IP) µÃµ½¿Í»§¶Ë CMac µØÖ·
public static string RequestF(string xPName,string xPType,int xLenDef) °²È«½ÓÊÕÊý¾ÝϵÁÐ
public static string Show_Cont(string xStr) ¹ýÂËÏÔʾ×Ö´®
public static str ......
ΪʲôҪ״̬¹ÜÀí
B/SÓëC/SÁ½Öּܹ¹µÄÓÐ×ÅÍêÈ«²»Í¬µÄÔËÐлúÖÆ¡£C/S»ù±¾ÉÏËùÓеÄÈí¼þ¹¦Äܶ¼ÔÚ¿Í»§¶Ë(Client)ÖÐʵÏÖ£¨ËùÒÔC/SÒ²³ÆΪÅÖ¿Í»§¶Ë¼Ü¹¹£©£¬·þÎñÆ÷¶Ë(Server)Ö»Ìṩ»ù´¡·þÎñ£¬×îΪµäÐ͵ÄÊÇÊý¾Ý¿â·þÎñÌṩÊý¾Ý·þÎñ¡£¶øB/S¼Ü¹¹Ö÷ÒªµÄ¹¦ÄÜÔÚ·þÎñ¶Ë(Server)ʵÏÖ£¬¿Í»§¶ËµÄä¯ÀÀÆ÷( ......
<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace ="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%
for (int i = 0; i <= 10; i++)
......
ASP.NETµÄÒ³Ãæ³õʼ»¯ÓëʼþÏê½â
Ò»¡¢³õʼ»¯
¡¡¡¡·µ±Ò³Ãæ±»Ìá½»ÇëÇóµÚÒ»¸ö·½·¨ÓÀÔ¶Êǹ¹Ô캯Êý¡£Äú¿ÉÒÔÔÚ¹¹Ô캯ÊýÀïÃæ³õʼһЩ×Ô¶¨ÒåÊôÐÔ»ò¶ÔÏ󣬲»¹ýÕâʱºòÒòΪҳÃ滹ûÓб»ÍêÈ«³õʼ»¯ËùÒÔ¶àÉÙ»áÓÐЩÏÞÖÆ¡£ÌرðµØ£¬ÄúÐèҪʹÓÃHttpContext¶ÔÏó¡£µ±Ç°¿ÉÒÔʹÓõĶÔÏó°üÀ¨QueryString, FormÒÔ¼°Cookies¼¯ºÏ£ ......
¿´ÁËÕÐƸÐÅÏ¢£¬Ã»·¢ÏÖ¼¸¸öÊÇÕÐ.netµÄ£¬¶¼ÊÇJava »òÕßC¡¢C++ ¡£·¢ÏÖ²ÎÓëµÄÏîÄ¿¾ÑéÔÚУ԰ÕÐƸÒѾûÓÐÓÅÊÆÁË£¬
ËƺõÍâÃæ¸üϲ»¶Java£¬µ«ÊǸöÈ˸оõ.NET»áÓкÜÇ¿´óµÄÇ÷ÊÆ£¬ËùÒÔ»¹ÊÇѧϰѧϰ£¬µ«ÊÇÒ²²»·ÅÆúC++µÄ¿ñÈÈ£¬ºÍwindows±à³ÌµÄѧϰ¡£
ºÃµÄµ¼Ê¦ÊÜÒæ·Ëdz£¡£¡ ......