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

C#»ñÈ¡µ±Ç°Â·¾¶µÄ·½·¨

//»ñÈ¡°üº¬Çåµ¥µÄÒѼÓÔØÎļþµÄ·¾¶»ò UNC λÖá£
public static string sApplicationPath = Assembly.GetExecutingAssembly ( ).Location;
//result: X:\xxx\xxx\xxx.dll (.dllÎļþËùÔÚµÄĿ¼+.dllÎļþÃû)
//»ñÈ¡µ±Ç°½ø³ÌµÄÍêÕû·¾¶£¬°üº¬ÎļþÃû(½ø³ÌÃû)¡£
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 stmp = Assembly.GetExecutingAssembly ( ).Location;
stmp = stmp.Substring ( 0 , stmp.LastIndexOf ( '\\' ) );//ɾ³ýÎļþÃû
if ( pathType == 1 )
return stmp + @"\inputLog.xml";
else if ( pathType == 2 )
return stmp + @"\MiddleDB.xml";
else
return stmp + @"\AppNo.xml";
using System.IO;
string path = "d:asdfasdf.bmp";
string fileNam


Ïà¹ØÎĵµ£º

sql c#

C-#ÈëÞ­µä(µÚÈý°æ).pdf
using System;
using System.Data;
using System.Data.SqlClient;
namespace My_Student
{
    static class Program
    {
       
        static void Main()
  &n ......

C# copydataÏûÏ¢´¦Àí

http://blog.csdn.net/carl2380/archive/2009/11/18/4826973.aspx
¼ò½é:
±¾ÎÄ×ÅÖØ½²ÊöÁËÈç¹ûÓÃWM_COPYDATAÏûÏ¢À´ÊµÏÖÁ½¸ö½ø³ÌÖ®¼ä´«µÝÊý¾Ý.
½ø³ÌÖ®¼äͨѶµÄ¼¸ÖÖ·½·¨:
ÔÚWindows³ÌÐòÖУ¬¸÷¸ö½ø³ÌÖ®¼ä³£³£ÐèÒª½»»»Êý¾Ý£¬½øÐÐÊý¾ÝͨѶ¡£³£Óõķ½·¨ÓÐ
  ʹÓÃÄÚ´æÓ³ÉäÎļþ
  ͨ¹ý¹²ÏíÄÚ´æDLL¹²ÏíÄÚ´æ
  ʹ ......

ÓÃC#·¢ËÍÓʼþµÄ¼¸ÖÖ·½·¨

1 JavaScript·¢ËÍÓʼþ   
<script language="javascript">
        function SendMail() {
            document.location = "mailto:seat@wicresoft.com;?subject=Feedback";
   &n ......

C#×Ö·û´®Ç³Îö

    ¸Õ¿ª²©²»¾Ã,¾ÍºÜÏëдµã¶«Î÷,µ«ÊdzöÓÚÖÖÖÖÔ­Òò¶¼Ã»¶¯ÊÖ¡£ÓÐÁ˲©¿Í×ܲ»ÄÜ¿Õ×Å£¬¾ÍÔÚ×ÁÄ¥×ÅдЩʲô¡£¸ÕºÃѧϰÁË×Ö·û´®µÄһЩ¶«Î÷£¬×öÁËϱʼǸоõ»¹²»´í£¬ÄóöÀ´É¹É¹...
    ÏÈ˵˵×Ö·û´®²Ù×÷µÄÐÔÄÜÎÊÌâ¡£C#ÖеÄ×Ö·û´®²Ù×÷£¬ÓõÃÒ²±È½Ï¶à£¬´ó¼Ò¶¼²»Ä°Éú¡£·´Õý¾ÍÊÇÉùÃ÷Ò»¸ö×Ö·û´®±äÁ¿£¬È»º ......

³£¼ûËã·¨C#ÃèÊö

ðÅÝÅÅÐò
using System;
class Program
{
public static void Main()
{
int[] a = new int[10];
Random rand = new Random();
for (int i = 0; i < 10; i++)
{
a[i] = rand.Next(10);//Éú³ÉËæ»úÊý¸øÊý×鸳ֵ
}
for (int i = 0; i < ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ