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;
// ͨ¹ýµ÷Ó
Ïà¹ØÎĵµ£º
ÓÉÓÚÐèҪʵÏÖÒÔϹ¦ÄÜ£º
Íø¹ØÍ¨¹ý´®¿Ú·¢ËÍÊý¾Ý¸øPC»ú£¬PC»úÊÕ¼¯Êý¾Ý²¢½âÎö±£´æµ½MySQLÖУ¬È»ºóJSPÒ³Ãæ¶ÁÈ¡MySQLÖеÄÊý¾Ý²¢ÏÔʾ¡£
ËùÒÔÀûÓÃC#Á¬½ÓMySQLÊý¾Ý³ÉΪÁ˱ØÐëÒª¾¹ýµÄ¹ý³Ì£¬Ôڴ˸øÓèÏêϸµÄ˵Ã÷¡£
1¡¢ÏÂÔØÐèÒªµÄÎļþMySQLDriverCS£¬ÏÂÔØµØÖ·Îª£ºhttp://sourceforge.net/projects/mysqldrivercs
2¡¢°²×°Îļþ£ºMySQ ......
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
&n ......
µÚÒ»ÖÖ
<%=RetInfo("DB","Êý¾Ý¿â") %>
<%=RetInfo("YX_UpFile","ÉÏ´«Îļþ") %>
<%=RetfileInfo("Include/", "¹ã¸æ")%>
//´Óǰ̨µ÷Óúǫ́·½·¨
//´Óǰ̨µ÷Óúǫ́µÄ·½·¨..²¢ÏòÆä·½·¨´«È벻ͬµÄ²ÎÊý!
µÚ¶þÖÖ
<ItemTemplate >
<%#Ret_stat(Convert.ToInt16(Eval("YX_Stat1")), "Èȵã")%>
......
XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......
public sealed class DbOper
{
///<summary>
/// DbOperÀàµÄ¹¹Ô캯Êý
///</summary>
private DbOper()
{
}
......