原创 C#登錄成功後,自動關閉登錄窗體

program.cs中 FrmLogin frm = new FrmLogin(); if(frm.ShowDialog() == DialogResult.OK) { Application.Run(new FrmMain());

原创 C#獲取文件夾下的文件

using System.IO; //獲取文件名 String[] folders = new string[1000]; folders = Directery.GetFiles("路徑","*.pdf"); foreach(st

原创 C#文件過濾器filter

OpenFileDialog ofd = new OpenFileDialog(); //顯示所有文件 ofd.Filter = null; //篩選特定文件(格式爲“標籤|*.後綴”,標籤爲字符串即可) ofd,Filer =

原创 將EXCEL數據導入到datagridview

using System.Data; using System.Data.OleDb; string strPath;//文件路徑名 private void btnExcel_Click(object sender,Event

原创 C#在父窗體的容器中打開子窗體

//檢查容器中是否已打開其他窗體 private void CloseForm() { foreach(Control item in this.panel1.Controls) { if(item is Form) {

原创 C#獲取屏幕大小從而設置窗體大小

using System.Drawing; public Form1() { InitializeComponent(); //在需要更改窗體大小的頁面增加以下代碼 Rectangle rect = new Rectangle

原创 VB.net messagebox定時自動關閉

在當前窗體Form1中添加timer1 在項目中添加窗體Form2 MessageBox.Show(Form2, "abcdefg", "test") Private Sub Timer1_Tick(sender As

原创 Visual Studio 連接MySql數據庫時無法選擇mysql database數據源

點擊連接https://dev.mysql.com/downloads/windows/visualstudio/ 下載mysql-for-visualstudio某一版本安裝,重啓Visual Studio即可 點擊下載

原创 vb.net 用RGB顯示控件的顏色

Label2.BackColor = Color.FromArgb(5, 42, 71)

原创 vb.net 時間顯示與計算

1.顯示系統時間 (1)添加Timer控件 Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Ti

原创 vb.net 取消DataGridView默認選中單元格

DataGridView1.DataSource = data Me.DataGridView1.ClearSelection() 在DataGridView加載數據源之後添加 Me.DataGridView1.ClearSel

原创 Sublime Text 軟件

1.官網下載 2.安裝package control View----Show Console調出控制檯 訪問https://packagecontrol.io/installation 複製相應代碼如 import urllib.

原创 ThinkPHP5上傳文件

前臺 <form action="{:url('index/upload')}" enctype="multipart/form-data" method="post"> <input type="file"

原创 vb.net連接文件服務器

新建IP快捷方式\192.168.1.123, 設置電腦中某個文件爲共享文件 ` 共享文件中添加Excel xlAppExcelFile.ActiveWorkbook.SaveAs("\\192.168.1.

原创 vb.net 分頁顯示數據

Imports Microsoft.Office.Interop.Excel Imports System.Windows.Forms Imports System.IO Imports MySql.Data.MySqlClient