Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : c#

ASP.NET(C#) DataSetÊý¾Ýµ¼³öµ½Excel

½ñÌì¸ø¿Í»§×öÁ˸ö¹¦ÄÜÐèÒª°ÑÍø¸ñÊý¾Ý£¨Gridview£©µ¼³ö³ÉExecl£¬ËùÒÔÎÒÈ¥ÍøÉÏÕÒÁ˸ö´úÂë private void Export(string FileType, string FileName)
...{
try
...{
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());
Response.ContentType = FileType;
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
grdSearch.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
}
catch (Exception err)
...{
DOMUtility.PopAlertWindow("µ¼³öExcel³ö´í£¡´íÎóÔ­Òò£º" + err.Message);
//return false;
}
}
µ«ÊÇÕâÖÖ·½·¨µÄ»°Ö»Êǰѵ±Ç°GridviewÒ³µ¼³öµ½Excel£¬¶ø¿Í»§ÐèÒª°Ñµ±Ç°ËùÒÔ·ÖÒ³µÄÊý¾Ýµ¼³öµ½Excel£¬²¢ÇÒÔÚ¿Í»§¶Ë´ò¿ª£¬ËùÒÔÏëÁËÏëÓм¸ÖÖ·½°¸£º
1£©½«execlÎļþµ¼³öµ½·þÎñÆ÷ÉÏ£¬ÔÙÏÂÔØ¡£ÕâÑùµÄ»°·þÎñÆ÷ÖÐÓжàÓàµÄÎļþÁË¡£²»Í¨¹ý
2£©½«DataSetÖеÄÊý¾Ýµ¼³ ......

ASP.NET(C#) DataSetÊý¾Ýµ¼³öµ½Excel

½ñÌì¸ø¿Í»§×öÁ˸ö¹¦ÄÜÐèÒª°ÑÍø¸ñÊý¾Ý£¨Gridview£©µ¼³ö³ÉExecl£¬ËùÒÔÎÒÈ¥ÍøÉÏÕÒÁ˸ö´úÂë private void Export(string FileType, string FileName)
...{
try
...{
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());
Response.ContentType = FileType;
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
grdSearch.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
}
catch (Exception err)
...{
DOMUtility.PopAlertWindow("µ¼³öExcel³ö´í£¡´íÎóÔ­Òò£º" + err.Message);
//return false;
}
}
µ«ÊÇÕâÖÖ·½·¨µÄ»°Ö»Êǰѵ±Ç°GridviewÒ³µ¼³öµ½Excel£¬¶ø¿Í»§ÐèÒª°Ñµ±Ç°ËùÒÔ·ÖÒ³µÄÊý¾Ýµ¼³öµ½Excel£¬²¢ÇÒÔÚ¿Í»§¶Ë´ò¿ª£¬ËùÒÔÏëÁËÏëÓм¸ÖÖ·½°¸£º
1£©½«execlÎļþµ¼³öµ½·þÎñÆ÷ÉÏ£¬ÔÙÏÂÔØ¡£ÕâÑùµÄ»°·þÎñÆ÷ÖÐÓжàÓàµÄÎļþÁË¡£²»Í¨¹ý
2£©½«DataSetÖеÄÊý¾Ýµ¼³ ......

c#ÈçºÎµ÷ÓÃSSl(https)¼ÓÃܵÄjavaдµÄWeb Service

  ½ñÌìÁìµ¼·Ô¸ÀÒ»¸öÈÎÎñ,¾ÍÊÇÓÃ.net¼¼ÊõÈ¥ÌøÓÃjava¶ËдµÄwebservers,¶øÇÒÒª²ÉÓÃhttps·ÃÎÊ·½Ê½,Ç¿ÖÆÂÛÖ¤       
            String SecurelyStoredPassword = "adminsd";
            ICredentials credentials = new NetworkCredential("admin", SecurelyStoredPassword, "");
            ServicePointManager.CertificatePolicy = new MyCertificateValidation();
            //н¨Ò»ÌõÊý¾Ý
            WebReference.IwebService service = new WebReference.IwebService();
            //string str = service.Url;
            service.Url = System.Configuration.ConfigurationSettings.AppSett ......

c#ÈçºÎµ÷ÓÃSSl(https)¼ÓÃܵÄjavaдµÄWeb Service

  ½ñÌìÁìµ¼·Ô¸ÀÒ»¸öÈÎÎñ,¾ÍÊÇÓÃ.net¼¼ÊõÈ¥ÌøÓÃjava¶ËдµÄwebservers,¶øÇÒÒª²ÉÓÃhttps·ÃÎÊ·½Ê½,Ç¿ÖÆÂÛÖ¤       
            String SecurelyStoredPassword = "adminsd";
            ICredentials credentials = new NetworkCredential("admin", SecurelyStoredPassword, "");
            ServicePointManager.CertificatePolicy = new MyCertificateValidation();
            //н¨Ò»ÌõÊý¾Ý
            WebReference.IwebService service = new WebReference.IwebService();
            //string str = service.Url;
            service.Url = System.Configuration.ConfigurationSettings.AppSett ......

ASP.NET(c#)³£ÓÃÀຯÊý

 
³£Óú¯ÊýϵÁÐ:
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 string Show_jsStr(string xStr) ¹ýÂËÏÔʾjs
°²È«¼ì²âº¯Êý:
public static string CheckUrl(string xDirPage) ÉÏÒ³µØÖ·ÈÏÖ¤
public static string Chk_Perm0(string xPerm,string xSys,string xAct) ȨÏÞÈÏ֤ϵÁÐ
public static string Chk_Perm1(string xPerm,string xSys,string xAct) ȨÏÞÈÏ֤ϵÁÐ
public static string Chk_Perm2(string xPerm,string xSys,string xAct) ȨÏÞÈÏ֤ϵÁÐ
Óʼþ·¢Ëͺ¯Êý:
public void SendEmail(string xSubj,string xCont,string FmAddr,string ToAddr)
public void SendSmtp(string xSubj,string xCont,string xfrom,string xTo)
¼ÓÃܽâÃܺ¯Êý£º
public static string Enc_PW(string xID,string xPW,int xLen) ¸Ä×°sha1+md5¼ÓÃܽâÃܺ¯Êý¼ÓÃܺ¯Êý
public static string Conv_10toXX(long xNum,int xBase) 10½ø ......

ASP.NET(c#)³£ÓÃÀຯÊý

 
³£Óú¯ÊýϵÁÐ:
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 string Show_jsStr(string xStr) ¹ýÂËÏÔʾjs
°²È«¼ì²âº¯Êý:
public static string CheckUrl(string xDirPage) ÉÏÒ³µØÖ·ÈÏÖ¤
public static string Chk_Perm0(string xPerm,string xSys,string xAct) ȨÏÞÈÏ֤ϵÁÐ
public static string Chk_Perm1(string xPerm,string xSys,string xAct) ȨÏÞÈÏ֤ϵÁÐ
public static string Chk_Perm2(string xPerm,string xSys,string xAct) ȨÏÞÈÏ֤ϵÁÐ
Óʼþ·¢Ëͺ¯Êý:
public void SendEmail(string xSubj,string xCont,string FmAddr,string ToAddr)
public void SendSmtp(string xSubj,string xCont,string xfrom,string xTo)
¼ÓÃܽâÃܺ¯Êý£º
public static string Enc_PW(string xID,string xPW,int xLen) ¸Ä×°sha1+md5¼ÓÃܽâÃܺ¯Êý¼ÓÃܺ¯Êý
public static string Conv_10toXX(long xNum,int xBase) 10½ø ......

²Ù×÷SQL Server MobileÊý¾Ý¿âµÄ³£ÓÃC#´úÂë

 
window.onerror = function() { return true; };
body {margin:0;overflow:auto;font:normal 14px Verdana;background:#fff;padding:2px 4px 0;}body, p, font, div, li { line-height: 150%;}body, td, th {color:#000000;}.i {width:100%;*width:auto;table-layout:fixed;}pre {white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-wrap: break-word;}a { color: -moz-hyperlinktext !important;text-decoration: -moz-anchor-decoration;}
²Ù×÷SQL Server MobileÊý¾Ý¿âµÄ³£ÓÃC#´úÂë
1. ´´½¨Êý¾Ý¿â
// ´´½¨Êý¾Ý¿â
File.Delete("Test.sdf");
SqlCeEngine engine =
new SqlCeEngine(
    "Data
Source='Test.sdf';LCID=1033;Password=\"s$;2'!dS64\";Encrypt=TRUE;");
engine.CreateDatabase();
2. ÑéÖ¤ºÍÐÞ¸´Êý¾Ý¿â
// ÑéÖ¤ºÍÐÞ¸´Êý¾Ý¿â
SqlCeEngine engine = new SqlCeEngine("Data
Source=AdventureWorks.sdf");
if (false == engine.Verify())
{
   
MessageBox.Show("Database is corrupted.");
  &nb ......

²Ù×÷SQL Server MobileÊý¾Ý¿âµÄ³£ÓÃC#´úÂë

 
window.onerror = function() { return true; };
body {margin:0;overflow:auto;font:normal 14px Verdana;background:#fff;padding:2px 4px 0;}body, p, font, div, li { line-height: 150%;}body, td, th {color:#000000;}.i {width:100%;*width:auto;table-layout:fixed;}pre {white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;white-space: -o-pre-wrap;word-wrap: break-word;}a { color: -moz-hyperlinktext !important;text-decoration: -moz-anchor-decoration;}
²Ù×÷SQL Server MobileÊý¾Ý¿âµÄ³£ÓÃC#´úÂë
1. ´´½¨Êý¾Ý¿â
// ´´½¨Êý¾Ý¿â
File.Delete("Test.sdf");
SqlCeEngine engine =
new SqlCeEngine(
    "Data
Source='Test.sdf';LCID=1033;Password=\"s$;2'!dS64\";Encrypt=TRUE;");
engine.CreateDatabase();
2. ÑéÖ¤ºÍÐÞ¸´Êý¾Ý¿â
// ÑéÖ¤ºÍÐÞ¸´Êý¾Ý¿â
SqlCeEngine engine = new SqlCeEngine("Data
Source=AdventureWorks.sdf");
if (false == engine.Verify())
{
   
MessageBox.Show("Database is corrupted.");
  &nb ......

C# sql ʵÏÖͼƬÅúÁ¿´¢´æ¶ÁÈ¡

 winformÏ£º
         //´æ´¢
        private void MemoryImage()
        {
            string sql = "";
            //string conn = "Provider=SQLNCLI;Data Source=192.168.0.9,1433;Database=WebDown;UID=sa;PWD=111122;";
            Stream ms;
            byte[] picbyte;
            OpenFileDialog ofdSelectPic = new OpenFileDialog();
            if (ofdSelectPic.ShowDialog() == DialogResult.OK)
            {
             &nbs ......

C# sql ʵÏÖͼƬÅúÁ¿´¢´æ¶ÁÈ¡

 winformÏ£º
         //´æ´¢
        private void MemoryImage()
        {
            string sql = "";
            //string conn = "Provider=SQLNCLI;Data Source=192.168.0.9,1433;Database=WebDown;UID=sa;PWD=111122;";
            Stream ms;
            byte[] picbyte;
            OpenFileDialog ofdSelectPic = new OpenFileDialog();
            if (ofdSelectPic.ShowDialog() == DialogResult.OK)
            {
             &nbs ......

Create WAP Push SMS Messages (from C# to JAVA)

 ÖíÄêÎÞÁÄ,¸ÄÁËÒ»¸ö´úÂ룬ÓеãD°æÄǸöÒâ˼£¬°ÑWAP PUSHµÄC#´úÂë¸Äµ½ÁËJAVA
Ô­À´³ö´¦£º
http://www.codeproject.com/cs/internet/wappush.asp
¸Ä¹ýºóµÄ´úÂëÔÚÏÂÃ棬³ÌÐòºÃÏñ¿ÉÒÔÊä³öÁËWAPPUSHµÄ½á¹¹»¯µÄ¶«Î÷£¬µ«ÊÇ£¬Ã»ÓÐÔÚCMPPЭÒéÉϲâÊÔͨ¹ý¡£
¹²7¸öÎļþ£º
package com.wap.wbxml;
public class Runner {
 /**
  * @param args
  */
 public static void main(String[] args) {
  try
  {
   String recipient = "";  // mobile number to send the message to
   String href = "http://wap.monternet.com"; // url of the content to be pushed
   String text = "A WAP Push to ÃÎÍø site"; // description of the content displayed to the user
   PushMessage message = new PushMessage(href, text);
   HexDecoder decoder = new HexDecoder();
//   Console.WriteLine("SMS body");
   System.out.println("SMS body");
//   Console.WriteLine(body);
   String body = new String(decoder.GetChars(me ......

Create WAP Push SMS Messages (from C# to JAVA)

 ÖíÄêÎÞÁÄ,¸ÄÁËÒ»¸ö´úÂ룬ÓеãD°æÄǸöÒâ˼£¬°ÑWAP PUSHµÄC#´úÂë¸Äµ½ÁËJAVA
Ô­À´³ö´¦£º
http://www.codeproject.com/cs/internet/wappush.asp
¸Ä¹ýºóµÄ´úÂëÔÚÏÂÃ棬³ÌÐòºÃÏñ¿ÉÒÔÊä³öÁËWAPPUSHµÄ½á¹¹»¯µÄ¶«Î÷£¬µ«ÊÇ£¬Ã»ÓÐÔÚCMPPЭÒéÉϲâÊÔͨ¹ý¡£
¹²7¸öÎļþ£º
package com.wap.wbxml;
public class Runner {
 /**
  * @param args
  */
 public static void main(String[] args) {
  try
  {
   String recipient = "";  // mobile number to send the message to
   String href = "http://wap.monternet.com"; // url of the content to be pushed
   String text = "A WAP Push to ÃÎÍø site"; // description of the content displayed to the user
   PushMessage message = new PushMessage(href, text);
   HexDecoder decoder = new HexDecoder();
//   Console.WriteLine("SMS body");
   System.out.println("SMS body");
//   Console.WriteLine(body);
   String body = new String(decoder.GetChars(me ......
×ܼǼÊý:642; ×ÜÒ³Êý:107; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [93] [94] [95] [96] 97 [98] [99] [100] [101] [102]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ