½ñÌì¸ø¿Í»§×öÁ˸ö¹¦ÄÜÐèÒª°ÑÍø¸ñÊý¾Ý£¨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ÖеÄÊý¾Ýµ¼³ ......
½ñÌì¸ø¿Í»§×öÁ˸ö¹¦ÄÜÐèÒª°ÑÍø¸ñÊý¾Ý£¨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ÖеÄÊý¾Ýµ¼³ ......
½ñÌìÁìµ¼·Ô¸ÀÒ»¸öÈÎÎñ,¾ÍÊÇÓÃ.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 ......
½ñÌìÁìµ¼·Ô¸ÀÒ»¸öÈÎÎñ,¾ÍÊÇÓÃ.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 ......
³£Óú¯ÊýϵÁÐ:
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½ø ......
³£Óú¯ÊýϵÁÐ:
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½ø ......
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 ......
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 ......
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 ......
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 ......
ÖíÄêÎÞÁÄ,¸ÄÁËÒ»¸ö´úÂ룬Óеã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 ......
ÖíÄêÎÞÁÄ,¸ÄÁËÒ»¸ö´úÂ룬Óеã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 ......