人生中第一台LCD掛了,這台LCD在我上大學的時候買的(2003)
其實修的話不如買一台新的,但還是有點捨不得(舊愛還是最美…),
於是…我燃起了要把它醫好的決心
在做了些功課知道要換什麼零件後!!!!

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

public static MapXLib.LayerInfo AddShpLayer(string DataPath, string LayerName, AxMapXLib.AxMap Axmap)
        {
            #region 載入圖檔並傳回圖層
            MapXLib.LayerInfo linfo = new MapXLib.LayerInfoClass();
            MapXLib.LayerInfo li = new MapXLib.LayerInfoClass();
            MapXLib.LayerInfo newlayer = new MapXLib.LayerInfoClass();
            MapXLib.Dataset dt = null;
            MapXLib.Layer lyr = null;
            FileInfo file = new FileInfo(DataPath + LayerName + ".shp");
            if (file.Exists)
            {   
                linfo.Type = MapXLib.LayerInfoTypeConstants.miLayerInfoTypeShape;
                linfo.AddParameter("Name", LayerName + "shp");
                linfo.AddParameter("FileSpec", DataPath + LayerName + ".shp");
                linfo.AddParameter("CoordSys", Axmap.NumericCoordSys);
                linfo.AddParameter("AutoCreateDataset", true);
                linfo.AddParameter("DatasetName", LayerName);
                lyr = Axmap.Layers.Add(linfo, Axmap.Layers.Count);
                lyr.BeginAccess(MapXLib.LayerBeginAccessConstants.miAccessRead);
                dt = lyr.DataSets[1];
                linfo = null;
                MapXLib.Dataset ds = Axmap.DataSets.Add(MapXLib.DatasetTypeConstants.miDataSetLayer, lyr, LayerName + "2", 0, 0, 0, dt.Fields, false);
                li.Type = MapXLib.LayerInfoTypeConstants.miLayerInfoTypeNewTable;
                FileInfo tabfile = new FileInfo(Application.StartupPath + "\\temp\\" + LayerName + ".tab");
                if (tabfile.Exists)
                {
                    tabfile.Delete();
                    tabfile = new FileInfo(Application.StartupPath + "\\temp\\" + LayerName + ".map");
                    tabfile.Delete();
                    tabfile = new FileInfo(Application.StartupPath + "\\temp\\" + LayerName + ".id");
                    tabfile.Delete();
                    tabfile = new FileInfo(Application.StartupPath + "\\temp\\" + LayerName + ".dat");
                    tabfile.Delete();
                }
                li.AddParameter("FileSpec", Application.StartupPath + "\\temp\\" + LayerName + ".tab");
                li.AddParameter("Name", LayerName);
                li.AddParameter("Fields", ds.Fields);
                li.AddParameter("AutoCreateDataset", true);
                //newlayer.AddParameter("CoordSys", Axmap.NumericCoordSys);
                li.AddParameter("Features", lyr.AllFeatures);
                return li;
            }
            else { return null; }
            #endregion
        }

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

update 資料表
set 欄位= replace(欄位, '被取代的值', '將取代的值')
where 欄位 like '%條件%'

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

SELECT * FROM table GROUP BY id1, id2 HAVING count(*)>1

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

刪除預設值
alter table person_commission drop DF_person_commission_pc_commission
修改欄位型態
alter table person_commission alter column pc_commission float
增加預設值
ALTER TABLE person_commission ADD  CONSTRAINT DF_person_commission_pc_commission  DEFAULT ((0))

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

 System.Media.SoundPlayer sp = new System.Media.SoundPlayer();
            sp.SoundLocation = @"C:\wav\lightning.wav";
            sp.Play(); // 撥放
            // sp.Stop(); // 停止

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

//報表
CargBillReport CBR = new CargBillReport();
//新增一個欄位      
dt.Columns.Add("barcode",System .Type.GetType ("System.Byte[]"));
//圖片
byte[] img = System.IO.File.ReadAllBytes("C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\Water lilies.jpg");
//加入圖片                    
dt.Rows[0]["barcode"] = img;
//填入報表          
CBR.SetDataSource(dt);
//預覽
 crystalReportViewer1.ReportSource = CBR;

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

//加密
public   static   string   Base64Encode(string   AStr)
{
        return   Convert.ToBase64String(Encoding.UTF8.GetBytes(AStr));
}

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

filepath是要儲存的路徑
FileBS是圖檔的byte[]
 ------------------------------
            try
            {
               
                FileStream BFile = new FileStream(filepath, FileMode.Create); //開啟"D:\test.txt"          
                BFile.Write(FileBS, 0, FileBS.GetUpperBound(0) + 1);
                BFile.Flush();
                BFile.Close();
           
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString()+"在儲存圖層時");
            }

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

 //MD5加密
        private String MD5code(String str)
        {
            System.Security.Cryptography.MD5CryptoServiceProvider md5Hasher=new            System.Security.Cryptography.MD5CryptoServiceProvider();
            Byte[] data = md5Hasher.ComputeHash((new System.Text.ASCIIEncoding()).GetBytes(str));
            System.Text.StringBuilder sBuilder = new System.Text.StringBuilder();   
            for (int i=0 ;i< data.Length; i++){
                sBuilder.Append(data[i].ToString("x2"));
            }     
            return sBuilder.ToString() ;
        }

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

 FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://帳號@ftp.XXXX.com.tw/ExcelFile.xls");
            request.Method = WebRequestMethods.Ftp.UploadFile;
            // FTP的帳密.
            request.Credentials = new NetworkCredential("帳號", "密碼");
            // 要上傳的檔案
            StreamReader sourceStream = new StreamReader("ExcelFile.xls");
            byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
            sourceStream.Close();
            request.ContentLength = fileContents.Length;
            Stream requestStream = request.GetRequestStream();
            requestStream.Write(fileContents, 0, fileContents.Length);
            requestStream.Close();
            FtpWebResponse response = (FtpWebResponse)request.GetResponse();
            Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription);
            response.Close();

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

--刪除主鍵
ALTER TABLE [dbo].[cuspayrec]  DROP CONSTRAINT [PK_CuspayRec]
GO
--刪除cp_id欄位
alter   table   [dbo].[cuspayrec]   drop   column   cp_id  
Go

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

1 2
Blog Stats
⚠️

成人內容提醒

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

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