2020年12月27日 星期日

限制不能使用最近三次的历史密码

 https://www.cnblogs.com/insus/archive/2012/01/30/2332013.html


https://dotblogs.com.tw/mis2000lab/2014/08/14/member_login_out-of-time_and_new-password

2020年12月8日 星期二

如何截取完整網頁畫面?Chrome快捷鍵讓你輕鬆取得高畫質長截圖

 https://www.bnext.com.tw/article/47401/chrome-screenshot


Windows為F12

Windows為Ctrl + Shift + P

輸入命令Capture full size screenshot(只輸前幾個字母就能找到),敲下Enter, Chrome就會自動截取整個網頁內容並保存至本機

2020年12月1日 星期二

C# 鎖USB

 https://blog.miniasp.com/post/2008/01/18/How-to-disable-the-use-of-USB-storage-devices

https://blog.xuite.net/kenny.pro2/blog/212310907

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)  //"禁用USB隨身碟"那個Button
        {
            if (textBox1.Text == "1qaz")  //每次都要先輸入此密碼 ,Button才能按
            {
                if (MessageBox.Show("是否確定要禁用隨身碟!!", "禁用!!", MessageBoxButtons.YesNo) == DialogResult.Yes)   // YES/NO 確認
                {
                    Reg_Method(@" ADD HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR /v Start /t REG_DWORD /d 4 /f");
                    MessageBox.Show("已禁用隨身碟 !!   隨身碟重拔插後生效");
                } 
            }
            else
                MessageBox.Show("密碼錯誤");
        }

        private void button2_Click(object sender, EventArgs e)  //"開放USB隨身碟"那個Button
        {
            if (textBox1.Text == "1qaz")
            {
                if (MessageBox.Show("是否確定要開放隨身碟!!", "開放!!", MessageBoxButtons.YesNo) == DialogResult.Yes)    // YES/NO 確認
                {
                    Reg_Method(@" ADD HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR /v Start /t REG_DWORD /d 3 /f");
                    MessageBox.Show("已開放隨身碟 !!   隨身碟重拔插後生效");
                }
            }
            else
                MessageBox.Show("密碼錯誤");
        }

        private void button3_Click(object sender, EventArgs e)  //"唯讀USB隨身碟"那個Button
        {
            if (textBox1.Text == "1qaz")
            {
                if (MessageBox.Show("是否確定要"唯讀"USB隨身碟!!", "唯讀!!", MessageBoxButtons.YesNo) == DialogResult.Yes)   // YES/NO 確認
                {
                    Reg_Method(@" ADD HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlStorageDevicePolicies /v WriteProtect /t REG_DWORD /d 1 /f");
                    MessageBox.Show("已唯讀隨身碟 !!   隨身碟重拔插後生效");
                }
            }
            else
                MessageBox.Show("密碼錯誤");
        }

        private void button4_Click(object sender, EventArgs e)  //"可寫入USB隨身碟"那個Button
        {
            if (textBox1.Text == "1qaz")
            {
                if (MessageBox.Show("是否確定要讓隨身碟可寫入!!", "可寫入!!", MessageBoxButtons.YesNo) == DialogResult.Yes)   // YES/NO 確認
                {
                    Reg_Method(@" ADD HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlStorageDevicePolicies /v WriteProtect /t REG_DWORD /d 0 /f");
                    MessageBox.Show("隨身碟已可寫入 !!   隨身碟重拔插後生效");
                }
            }
            else
                MessageBox.Show("密碼錯誤");
        }

        private void button5_Click(object sender, EventArgs e)  //說明那個Button
        {
            MessageBox.Show("禁用USB隨身碟 : 禁用所有Windows認定的USB儲存裝置"
                + Environment.NewLine + "開放USB隨身碟 : 開放所有Windows認定的USB儲存裝置"
                + Environment.NewLine + "唯讀USB隨身碟 : USB儲存裝置,只能讀取無法寫入(限此台電腦)"
                + Environment.NewLine + "可寫入USB隨身碟 : USB儲存裝置,只能讀取可讀可寫(限此台電腦)");
        }

        // --------------------------------  Register Method  ---------------------------------------------------
        private static void Reg_Method(string x)
        {
            ProcessStartInfo reg = new ProcessStartInfo("reg.exe", x);
            reg.WindowStyle = ProcessWindowStyle.Hidden;
            Process.Start(reg);
        }
    }
}

執行起來Form的樣子:



WPF聊天室应用(ASP.NET Core SignalR)

  WPF聊天室应用(ASP.NET Core SignalR) https://www.bilibili.com/video/BV1Q741187Si?p=2 https://www.bilibili.com/video/BV1UV411e75T?from=search&...