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

C#(ASP.Net)»ñÈ¡µ±Ç°Â·¾¶µÄ·½·¨¼¯ºÏ

//»ñÈ¡µ±Ç°½ø³ÌµÄÍêÕû·¾¶£¬°üº¬ÎļþÃû(½ø³ÌÃû)¡£  
string str = this.GetType().Assembly.Location;  
result: X:\xxx\xxx\xxx.exe (.exeÎļþËùÔÚµÄĿ¼+.exeÎļþÃû)  
//»ñÈ¡Ð嵀 Process ×é¼þ²¢½«ÆäÓ뵱ǰ»î¶¯µÄ½ø³Ì¹ØÁªµÄÖ÷Ä£¿éµÄÍêÕû·¾¶£¬°üº¬ÎļþÃû(½ø³ÌÃû)¡£  
string str = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;  
result: X:\xxx\xxx\xxx.exe (.exeÎļþËùÔÚµÄĿ¼+.exeÎļþÃû)  
//»ñÈ¡ºÍÉèÖõ±Ç°Ä¿Â¼£¨¼´¸Ã½ø³Ì´ÓÖÐÆô¶¯µÄĿ¼£©µÄÍêÈ«ÏÞ¶¨Â·¾¶¡£  
string str = System.Environment.CurrentDirectory;  
result: X:\xxx\xxx (.exeÎļþËùÔÚµÄĿ¼)  
//»ñÈ¡µ±Ç° Thread µÄµ±Ç°Ó¦ÓóÌÐòÓòµÄ»ùĿ¼£¬ËüÓɳÌÐò¼¯³åÍ»½â¾ö³ÌÐòÓÃÀ´Ì½²â³ÌÐò¼¯¡£  
string str = System.AppDomain.CurrentDomain.BaseDirectory;  
result: X:\xxx\xxx\ (.exeÎļþËùÔÚµÄĿ¼+"\")  
//»ñÈ¡ºÍÉèÖðüº¬¸ÃÓ¦ÓóÌÐòµÄĿ¼µÄÃû³Æ¡£  
string str = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;  
result: X:\xxx\xxx\ (.exeÎļþËùÔÚµÄĿ¼+"\")  
//»ñÈ¡Æô¶¯ÁËÓ¦ÓóÌÐòµÄ¿ÉÖ´ÐÐÎļþµÄ·¾¶£¬²»°üÀ¨¿ÉÖ´ÐÐÎļþµÄÃû³Æ¡£  
string str = System.Windows.Forms.Application.StartupPath;  
result: X:\xxx\xxx (.exeÎļþËùÔÚµÄĿ¼)  
//»ñÈ¡Æô¶¯ÁËÓ¦ÓóÌÐòµÄ¿ÉÖ´ÐÐÎļþµÄ·¾¶£¬°üÀ¨¿ÉÖ´ÐÐÎļþµÄÃû³Æ¡£  
string str = System.Windows.Forms.Application.ExecutablePath;  
result: X:\xxx\xxx\xxx.exe (.exeÎļþËùÔÚµÄĿ¼+.exeÎļþÃû)  
//»ñȡӦÓóÌÐòµÄµ±Ç°¹¤×÷Ŀ¼(²»¿É¿¿)¡£  
string str = System.IO.Directory.GetCurrentDirectory();  
result: X:\xxx\xxx (.exeÎļþËùÔÚµÄĿ¼) 
//»ñÈ¡µ±Ç°½ø³ÌµÄÍêÕû·¾¶£¬°üº¬ÎļþÃû(½ø³ÌÃû)¡£
string str = this.GetType().Assembly.Location;
result: X:\xxx\xxx\xxx.exe (.exeÎļþËùÔÚµÄĿ¼+.exeÎļþÃû)
//»ñÈ¡Ð嵀 Process ×é¼þ²¢½«ÆäÓ뵱ǰ»î¶¯µÄ½ø³Ì¹ØÁªµÄÖ÷Ä£¿éµÄÍêÕû·¾¶£¬°üº¬ÎļþÃû(½ø³ÌÃû)¡£
string str = System.Diagnostics.Process.GetCurrentPro


Ïà¹ØÎĵµ£º

C#ÖÐindexOfÓ÷¨

IndexOf()
²éÕÒ×Ö´®ÖÐÖ¸¶¨×Ö·û»ò×Ö´®Ê״γöÏÖµÄλÖÃ,·µÊ×Ë÷ÒýÖµ£¬È磺
str1.IndexOf("×Ö")£» //²éÕÒ“×Ö”ÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö´®")£»//²éÕÒ“×Ö´®”µÄµÚÒ»¸ö×Ö·ûÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö",start,end)£»//´Óstr1µÚstart+1¸ö×Ö·ûÆð£¬²éÕÒend¸ö×Ö·û£¬²éÕ ......

jsÓëc# Ö®¼äÊý¾ÝºÍ·½·¨½»»¥

function loginNull()
{
if (document.form1.txtName.value =="")
{
//alert("ÇëÌîдÄúµÄÓû§Ãû£¡");
WebForm1.show("Óû§Ãû´íÎó,²»ÄÜΪ¿Õ").value;
//alert("ÇëÌîдÄúµÄÓû§Ãû£¡");
document.form1.txtName.focus();
return false;
}
var filter=/^s*[.A-Za-z0-9_-]{5,15}s*$/;
if (!filter.test(document.form ......

asp.netͼƬÑéÖ¤Âë

asp.netϵͳ£¬ÔڵǼ»ò×¢²áʱ³£ÌṩÊý×Ö»ò×Ö·û»ìºÏµÄÑéÖ¤Â룬ÕâÀï½éÉÜÈçºÎ²Ù×÷¡£
1£¬Default Ò³Ãæ
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  & ......

c#ÖжàÏß³Ìͬ²½½â¾ö·½°¸

c#ÖжàÏß³Ìͬ²½½â¾ö·½°¸
C#ÖжÔÓÚ¶àÏ̱߳à³ÌÓкܺõÄÖ§³Ö£¬³£ÓõÄÓÐÒÔϼ¸ÖÖ½â¾ö·½°¸£º
           1. Lock(object) ¶ÔÐèҪͬ²½µÄ´úÂë¿é¼ÓËø£»
¡¡¡¡¡¡¡¡2. Monitor Class
¡¡¡¡¡¡¡¡3. ReaderWriterLock Class¡¡¡¡¡¡
       &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ