Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C# ¿ìËٹػú´úÂë

½ñÌìÓõ½Õâ¸ö£¬ÍøÉÏÕÒ¸ö²»´íµÄ£¬±£´æÏÂÀ´¡£
×¢Ò⣺Õâ¸ö·½·¨ÊÇ¿ìËٹػú£¬²»»á±£´æÄãµÄÈκÎδ±£´æÐÅÏ¢¡£
// Õâ¸ö½á¹¹Ì彫»á´«µÝ¸øAPI¡£Ê¹ÓÃStructLayout
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct TokPriv1Luid
{
public int Count;
public long Luid;
public int Attr;
}
// µ¼ÈëµÄ·½·¨±ØÐëÊÇstatic externµÄ£¬²¢ÇÒûÓз½·¨Ìå¡£µ÷ÓÃÕâЩ·½·¨¾ÍÏ൱ÓÚµ÷ÓÃWindows API¡£
[DllImport("kernel32.dll", ExactSpelling = true)]
internal static extern IntPtr GetCurrentProcess();
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok);
[DllImport("advapi32.dll", SetLastError = true)]
internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall,
ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);
[DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
internal static extern bool ExitWindowsEx(int flg, int rea);
// ÒÔ϶¨ÒåÁËÔÚµ÷ÓÃWinAPIʱÐèÒªµÄ³£Êý¡£ÕâЩ³£Êýͨ³£¿ÉÒÔ´ÓPlatform SDKµÄ°üº¬Îļþ£¨Í·Îļþ£©ÖÐÕÒµ½
internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
internal const int TOKEN_QUERY = 0x00000008;
internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
internal const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
internal const int EWX_SHUTDOWN = 0x00000001;
//internal const int EWX_LOGOFF = 0x00000000;
//internal const int EWX_REBOOT = 0x00000002;
//internal const int EWX_FORCE = 0x00000004;
//internal const int EWX_POWEROFF = 0x00000008;
//internal const int EWX_FORCEIFHUNG = 0x00000010;
// ͨ¹ýµ÷Ó


Ïà¹ØÎĵµ£º

C#´¦Àíoracle lobµÄÀý×Ó

  protected void BindData1()
    {
        OracleConnection orcn = new OracleConnection("User ID=wesoftwcp; Password=wesoft; Data Source=oradb");
        orcn.Open();
      &nb ......

C#Á¬½ÓMySQL½øÐвÙ×÷µÄ·½·¨

ÓÉÓÚÐèҪʵÏÖÒÔϹ¦ÄÜ£º
Íø¹ØÍ¨¹ý´®¿Ú·¢ËÍÊý¾Ý¸øPC»ú£¬PC»úÊÕ¼¯Êý¾Ý²¢½âÎö±£´æµ½MySQLÖУ¬È»ºóJSPÒ³Ãæ¶ÁÈ¡MySQLÖеÄÊý¾Ý²¢ÏÔʾ¡£
ËùÒÔÀûÓÃC#Á¬½ÓMySQLÊý¾Ý³ÉΪÁ˱ØÐëÒª¾­¹ýµÄ¹ý³Ì£¬Ôڴ˸øÓèÏêϸµÄ˵Ã÷¡£
1¡¢ÏÂÔØÐèÒªµÄÎļþMySQLDriverCS£¬ÏÂÔØµØÖ·Îª£ºhttp://sourceforge.net/projects/mysqldrivercs
2¡¢°²×°Îļþ£ºMySQ ......

C#ÖжÔXML½Úµã½øÐÐÔöɾ¸Ä²é

ºÅ³ÆxmlhelperµÄÒ»¸öÀà
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
/// </summary>
public class XMLHelper
{
public X ......

C# Active¿Ø¼þ£¬²¢´¥·¢javascriptʼþ

´´½¨Ò»¸öWinformÓû§¿Ø¼þ UserControl1
 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
namespace MyActiveT ......

ASP.NET(C#)³£ÓôúÂë30Àý

1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ