public partial class Form1 : Form
    {
        public event EventHandler BossEventHandler; //處理事件的物件

baba 發表在 痞客邦 留言(0) 人氣()

 public void output(string myConnectionString)
        {
            DataTable DT = new DataTable();
            // If the connection string is empty, use default.
            if (myConnectionString == "")

baba 發表在 痞客邦 留言(0) 人氣()

using System.Net;
using System.IO;
using System.Web;
using HtmlAgilityPack;

baba 發表在 痞客邦 留言(0) 人氣()

(1) 原始寫法 

List<RetestPackage> mRetestPkgList = new List<RetestPackage>();
RetestPackage AR = new RetestPackage();
AR.ID = InPut2DStr;
mRetestPkgList.Add(AR);

baba 發表在 痞客邦 留言(0) 人氣()

public DataTable ReadCSVFile(string strFilePath, string strFileName) // strFilePath 為檔案所在資料夾,strFileName 為檔案名稱
            {
                    OleDbConnection connection = new OleDbConnection(string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}; Extended Properties=""text;HDR=Yes;FMT=Delimited"";", strFilePath));
                    OleDbCommand command = new OleDbCommand("SELECT * FROM " + strFileName, connection);
                    OleDbDataAdapter adapter = new OleDbDataAdapter(command);

baba 發表在 痞客邦 留言(0) 人氣()

  using System.Data.OleDb;

  public static OleDbConnection OleDbOpenConn(string Database)
        {
            string cnstr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Database);
            OleDbConnection icn = new OleDbConnection();

baba 發表在 痞客邦 留言(0) 人氣()

delegate void mydelegate(string name);      //宣告delegate變數  mydelegate
    class Program
    {
        static void Main(string[] args)
        {

baba 發表在 痞客邦 留言(0) 人氣()

 class Program
    {
        //宣告網路資料流變數
        NetworkStream myNetworkStream;
        //宣告 Tcp 用戶端物件

baba 發表在 痞客邦 留言(0) 人氣()

            using System.Net.Sockets;

            System.Net.IPAddress theIPAddress;      //ip變數
            theIPAddress = System.Net.IPAddress.Parse("127.0.0.1"); // 127.0.0.1
            TcpListener myTcpListener = new TcpListener(theIPAddress, 36000); //監聽變數 myTcpListener
            myTcpListener.Start(); //監聽開始

baba 發表在 痞客邦 留言(0) 人氣()

            WebClient wc = new WebClient();  //宣告web client物件
            wc.Credentials = new NetworkCredential(account, password); //登陸ftp
            wc.DownloadFile("ftp://127.0.0.1//abcd.txt", "C:\\Users\\8044\\Desktop\\abcd.txt");     //下載
            wc.UploadFile("ftp://127.0.0.1//ghig.xls", "C:\\Users\\8044\\Desktop\\9906.xls");     //上傳

baba 發表在 痞客邦 留言(0) 人氣()

 FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://127.0.0.1//55555.txt");
            request.Method = WebRequestMethods.Ftp.DownloadFile;  
            request.Credentials = new NetworkCredential("ftpuser", "Aa123456");

baba 發表在 痞客邦 留言(0) 人氣()

                FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://127.0.0.1//123.txt"); //FTP及檔案位置
                request.Method = WebRequestMethods.Ftp.UploadFile;                                    //FTP功能選擇  上傳 下載
                request.Credentials = new NetworkCredential("ftpuser","Aa123456");                    //輸入FTP帳號密碼

baba 發表在 痞客邦 留言(0) 人氣()

1 2
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。