C#µ¥ÊµÀýÔËÐеÄʵÏÖ
Ö÷Ҫͨ¹ýÐÞ¸Äprogram.csÎļþµÄÄÚÈÝÀ´ÊµÏÖ¡£
Ê×ÏÈÔÚÌí¼Ó¼¸¸öÃû¿Õ¼äµÄÒýÓãº
using System.Diagnostics; //ʹÓÃProcess
using System.Runtime.InteropServices; //ʹÓÃDllImport
using System.Reflection; //ʹÓÃAssembly
È»ºóÔÚÒýÈëϵͳAPI £º
[DllImport("User32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
[DllImport("User32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
private const int WS_SHOWNORMAL = 1;
ÔÙÌí¼Ó¼¸¸ö³ÉÔ±º¯Êý£º
public static Process GetPreIns()
{//»ñÈ¡µ±Ç°½ø³Ì¾ä±ú
Process cur= Process.GetCurrentProcess();
Process[] procs = Process.GetProcessesByName(current.ProcessName);
foreach (Process proc in procs )
{ //±éÀú£¬ÒÔ»ñȡǰһʵÀýµÄ¾ä±ú
if (proc .Id != cur.Id) //ºöÂÔÏÖÓеÄÀý³Ì
{
//È·±£Àý³Ì´ÓEXEÎļþÔËÐÐ
Ïà¹ØÎĵµ£º
ÔÚC#Àï´´½¨ºÍʹÓÃC·ç¸ñÊý¾Ý½á¹¹£¬¼´·ÇÍйܵÄÊý¾Ý½á¹¹£¬¿ÉÒÔÌá¸ßÐÔÄÜ¡£
1 Êý¾Ý½á¹¹µÄ¶¨Òå
¿´ÏÂÃæÀý×Ó£º
unsafe struct A {
public int x;
}
unsafe struct B {
pu ......
1.Response.Redirect("http://www.jb51.net",false);
Ä¿±êÒ³ÃæºÍÔÒ³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
Ìø×ªÏòеÄÒ³Ãæ£¬Ô´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½·¨µ¼ÖÂä¯ÀÀÆ÷Á´½Óµ½Ò»¸öÖ¸¶¨µÄURL¡£µ±Response.Redirect()·½·¨± ......
дcookie
¡¡¡¡1 HttpCookie cookie = new HttpCookie("Info");//¶¨Òåcookie¶ÔÏóÒÔ¼°ÃûΪInfoµÄÏî
¡¡¡¡2 DateTime dt = DateTime.Now;//¶¨Òåʱ¼ä¶ÔÏó
¡¡¡¡3 TimeSpan ts=new TimeSpan(1,0,0,0);//cookieÓÐЧ×÷ÓÃʱ¼ä£¬¾ßÌå²émsdn
¡¡¡¡4 cookie.Expires = dt.Add(ts);//Ìí¼Ó×÷ÓÃʱ¼ä
¡¡¡¡5 cookie.Values.Add("user","cx ......
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient; ......