image

 1: class test
 2: {
 3: public override string ToString()
 4: {
 5: return "c# 真好用";
 6: }
 7: }

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

FileStream –> object   OKFileStream->Stream   OKFileStream->string      NGFileStream->StreamReader  NG
 1: private void button1_Click(object sender, EventArgs e)
 2: {
 3: using (FileStream fs = new FileStream(@"c:\log.txt",System.IO.FileMode.Create))
 4: {
 5: object obj = fs as object;
 6: if (obj != null)
 7: {
 8: MessageBox.Show("轉換為Object成功!", "提示!");
 9: }
 10: else
 11: {
 12: MessageBox.Show("轉換為Object不成功!", "提示!");
 13: }
 14: Stream strm = obj as Stream;
 15: if (strm != null)
 16: {
 17: MessageBox.Show("轉換為Stream成功!", "提示!");
 18: }
 19: else
 20: {
 21: MessageBox.Show("轉換為Stream不成功!", "提示!");
 22: }
 23: string str = obj as string;
 24: if (str != null)
 25: {
 26: MessageBox.Show("轉換為string成功!", "提示!");
 27: }
 28: else
 29: {
 30: MessageBox.Show("轉換為string不成功!", "提示!");
 31: }
 32:  
 33: StreamReader f = obj as StreamReader;
 34: if (str != null)
 35: {
 36: MessageBox.Show("轉換為StreamReader成功!", "提示!");
 37: }
 38: else
 39: {
 40: MessageBox.Show("轉換為StreamReader不成功!", "提示!");
 41: }
 42:  
 43: }

44: }

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

image
資料來源: 建置專案時出現了「在憑證存放區中找不到資訊清單簽署憑證」錯誤第一種解決方法 跟有憑證的人申請索取憑證第二種解決方法 將在專案屬性中的簽署頁籤內將簽署的checkbox勾選取消

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

image

 1: using System;
 2: using System.Collections.Generic;
 3: using System.ComponentModel;
 4: using System.Data;
 5: using System.Drawing;
 6: using System.Linq;
 7: using System.Text;
 8: using System.Windows.Forms;
 9: using System;
 10: using System.Runtime.InteropServices;
 11:  
 12: namespace HideTaskBarEx
 13: {
 14:  
 15: public partial class Form1 : Form
 16: {
 17: [DllImport("user32.dll")]
 18: private static extern IntPtr FindWindow(String className, String windowText);
 19: [DllImport("user32.dll")]
 20: private static extern Int32 ShowWindow(IntPtr hwnd, Int32 command);
 21: private const Int32 HIDE = 0;
 22: private const Int32 SHOW = 1;
 23: public Form1()
 24: {
 25: InitializeComponent();
 26: }
 27:  
 28: private void button1_Click(object sender, EventArgs e)
 29: {
 30: IntPtr TaskBar = FindWindow("Shell_TrayWnd", "");
 31: ShowWindow(TaskBar, HIDE);
 32: }
 33:  
 34: private void button2_Click(object sender, System.EventArgs e)
 35: {
 36: IntPtr TaskBar = FindWindow("Shell_TrayWnd", "");
 37: ShowWindow(TaskBar, SHOW);
 38: }
 39: }
 40: }

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

image

資源檔案加入一張圖片請先下載Icon: http://findicons.com/icon/583421/forms程式碼:
 1: public partial class Form1 : Form
 2: {
 3: NotifyIcon notifyIcon;
 4:  
 5: private void Initial()
 6: {
 7: notifyIcon = new NotifyIcon();
 8: notifyIcon.BalloonTipText = "Program is Running..."; //設定通知欄提示的文字
 9: notifyIcon.Text = "NotifyIcon Sample"; //設定通知欄在滑鼠移至Icon上的要顯示的文字
 10: notifyIcon.Icon = (System.Drawing.Icon)Properties.Resources.forms; //決定一個Logo
 11: notifyIcon.Click += (sender, e) => //設定按下Icon的事件
 12: {
 13: notifyIcon.Visible = false;
 14: this.ShowInTaskbar = true;
 15: this.Show();
 16: };
 17:  
 18: //設定右鍵選單
 19: ContextMenu contextMenu = new ContextMenu();
 20: MenuItem menuItem = new MenuItem();
 21: menuItem.Checked = true;
 22: menuItem.Index = 1;
 23: menuItem.Text = "顯示";
 24: menuItem.Click += (sender, e) => //設定按下事件
 25: {
 26: MessageBox.Show("開始...");
 27: };
 28: contextMenu.MenuItems.Add(menuItem);
 29: notifyIcon.ContextMenu = contextMenu;
 30: }
 31: public Form1()
 32: {
 33: InitializeComponent();
 34: Initial();
 35: }
 36:  
 37: private void button1_Click(object sender, EventArgs e)
 38: {
 39: this.ShowInTaskbar = false;
 40: this.Hide();
 41: notifyIcon.Visible = true;
 42: notifyIcon.ShowBalloonTip(1, "測試", "測試內容", ToolTipIcon.Info);
 43: }

44: }

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

image

 1: private void button1_Click(object sender, EventArgs e)
 2: {
 3: listBox1.Items.Clear();
 4: foreach (var screen in Screen.AllScreens)
 5: {
 6: listBox1.Items.Add("Device nAME: " + screen.DeviceName);
 7: listBox1.Items.Add("Bounds: " + screen.Bounds.ToString());
 8: listBox1.Items.Add("Type: " + screen.GetType().ToString());
 9: listBox1.Items.Add("Working Area: " + screen.WorkingArea.ToString());
 10: listBox1.Items.Add("Primary Screen: " + screen.Primary.ToString());
 11: listBox1.Items.Add("=================================================");
 12: }
 13: }

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

image
原本只想在DataGridView加入ComboBox的功能, 結果網路一查之下, 發現這也是一門學問,.NET已經將一些常用的如DataGridView + ComboBoxDataGridView + CheckBox DataGridView + ButtonDataGridView + Image等諸如此類的元件都已經整合在一起, 真是棒!但是有些還是得自己手動加入DataGridView + NumericUpDownDataGridView + RadioButton網路上的MSDN範例又臭又長,實在難以下嚥,

me1237guy 發表在 痞客邦 留言(2) 人氣()

image
今天在寫一個簡單的<開始><暫停><停止>同一個thread, 發現thread一旦被suspended, 則必須透過          try
          {
              gProcThread.Abort();
          }

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

今天開機發現馬達參數跑掉, 導致無法運行, 研究發現ADLINK 8164 Motion Card初始化會載入一組參數檔案備份檔案 C:\Users\GTVision\AppData\Local\VirtualStore\Windows\8164MC.ini
實際讀取 C:\windows\8164MC.ini此要確認C:\windows\8164MC.ini的檔案沒有被覆蓋, 或是自行指定路徑

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

image
同時設定多台內網電腦時, 遠端桌面工具變得相當方便, 今天發生無法連線卻ping得到的窘境,原來是防火牆所造成…附帶一提, TeamViewer僅支援外網OK的環境下使用防火牆 –> 進階設定新增-> 輸入規則

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

image
啟動桌面捷徑MultiCam Studio.exe 攝影機軟體 以下說明為MultiCam  6.9.3.2316版本Source –> New選擇GrabLink series點選DALSA前面+符號展開選單點選Part Number: P3-80-12k40選擇第2個, Grabber-Controlled rate and exposure 也就是由影像擷取卡決定取樣速度和曝光時間=======================================================================Tools->Board Information記得在Serial ControlA輸入Comport名稱, 由使用者自行定義

me1237guy 發表在 痞客邦 留言(4) 人氣()

image
SaperaCameraSDK740Setup.exe



c:\Program Files\Teledyne DALSA\Sapera\

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

Blog Stats
⚠️

成人內容提醒

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

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