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
Ïà¹ØÎĵµ£º
IndexOf()
²éÕÒ×Ö´®ÖÐÖ¸¶¨×Ö·û»ò×Ö´®Ê״γöÏÖµÄλÖÃ,·µÊ×Ë÷ÒýÖµ£¬È磺
str1.IndexOf("×Ö")£» //²éÕÒ“×Ö”ÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö´®")£»//²éÕÒ“×Ö´®”µÄµÚÒ»¸ö×Ö·ûÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö",start,end)£»//´Óstr1µÚstart+1¸ö×Ö·ûÆð£¬²éÕÒend¸ö×Ö·û£¬²éÕ ......
±í¼ò½à
"¹«½»Ïß·Êý¾Ý¿â"
ÓõÄsqlÊý¾Ý¿â
admin±í
username
password
admin
admin
busroute ±í
³µ´Î
stop-name-id
Õ¾´Î
Ʊ¼Û
68
4
1
1
34
5
6
1.5
25
6
3
2
Õ¾µã±í
id
stop-name
1
»ð³µÕ¾
³µ´Î±í
id
³µ´Î
1
1
Èç¹ûÒªÓûùÓÚvb.netµÄasp.net±à³Ì
µÇ½µÄʱºò¸ÃÔõô±à³Ì°¡,Êý¾Ý¿âÊÇÓÃsql× ......
½á¹¹ÌåµÄ¶¨Òå:
½á¹¹ÌåÒ²¿ÉÒÔÏóÀàÒ»Ñù¿ÉÒÔµ¥¶À¶¨Òå.
class a{};
struct a{};
½á¹¹ÌåÒ²¿ÉÒÔÔÚÃû×ÖÇ°Ãæ¼ÓÈë¿ØÖÆ·ÃÎÊ·û.
public struct student{};
internal struct student{};
Èç¹û½á¹¹ÌåstudentûÓÐpublice»òÕßinternalµÄÉùÃ÷ Ààprogram¾ÍÎÞ·¨Ê¹ÓÃstudent½á¹¹¶¨Òå obj¶ÔÏó
Èç¹û½á¹¹ÌåstudentµÄÔªËØÃ»ÓÐpublicµÄ ......