2025年7月31日 星期四

STEAM 教育學習網

 STEAM 教育學習網

----

內容超棒的! 值得去看看學習

引用官網資訊:


關於 STEAM 教育

STEAM 教育由五個單字組成,分別是 Science ( 科學 )、Technology ( 技術 )、Engineering ( 工程 )、Arts ( 藝術 ) 和 Mathematics ( 數學 ),因此 STEAM 教育也稱作「跨學科教育」。STEAM 教育延伸 STEM 的精神,除了強調「動手做」以及「解決問題」的能力,更將藝術 Art、技術、工程和數學整合,創造出能夠應用於真實生活的應用。

STEAM 教育學習網秉持著 STEAM/STEM 的精神,透過一系列免費且高品質的教學與範例,讓所有人都能輕鬆跨入 STEAM 的學習領域。

Netstat 查 port 連線

 參考引用:Windows Netstat | Display Active TCP / UDP Ports & Connections


說明

netstat -aon

可以搭配 findstr 篩選搜尋結果,例如只搜尋 443 port (TCP HTTPS) 相關的 Connections。

netstat -aon | findstr :443



2025年7月29日 星期二

[IIS]架設ASP.NET網站發生HTTP 錯誤 500.19 - Internal Server Error

 HTTP 錯誤 500.19 - Internal Server Error

設定錯誤 這個設定區段不能在這個路徑中使用。

當區段在父層級被鎖定時就會發生這種情況。

鎖定可能是預設 (overrideModeDefault="Deny"),或是由位置標記使用 overrideMode="Deny" 或繼承的 allowOverride="false" 明確設定。


IIS 沒有安裝ASP.NET

補裝後,就正常了




2025年7月28日 星期一

VS2022 JSON 結構轉成 C# 的 Class

 將 JSON 或 XML 貼上為類別

--

真是好用的工具

在 Visual Studio 中,您可以從 JSON 或 XML 檔案複製文字,然後將文本作為類粘貼到 C# 或 Visual Basic 代碼中。 為此,請選擇Edit>Paste Special 並選擇 Paste JSON As Classes 或 Paste XML As Classes。



在您的環境中啟用 TLS 1.2 的支援,以因應 Microsoft Entra TLS 1.1 和 1.0 的淘汰

 在您的環境中啟用 TLS 1.2 的支援,以因應 Microsoft Entra TLS 1.1 和 1.0 的淘汰

Microsoft Entra Connect 的 TLS 1.2 強制

---

OS / windows Server 

現一些線上串金流都被要求必須採用較新的密碼套件+HTTPS +TLS




2025年7月10日 星期四

關於購買本工作室研發產品程式碼

程式碼:

對於本工作室產品研發的程式碼有興趣購買的,可以寫信詢洽!


專案開發:

歡迎各行各業,有需求須要軟體客製開發;本工作室都能承包


部分開發分包:

歡迎各公司或工作室,有難度性的或是須要分包出來的案件;本工作室也能承包


開發語言:

ASP.NET  / ASP Core 

VB .NET / C# .NET / Framework 


開發工具:

vs2022 community





2025年6月24日 星期二

TSC条码打印机C#例程(tsclib.dll调用) 【转】

 TSC条码打印机C#例程(tsclib.dll调用) 【转】

//----  program.cs


using System;

using System.Collections.Generic;

using System.Windows.Forms;


using System.Runtime.InteropServices;

public class TSCLIB_DLL

{

 [DllImport("TSCLIB.dll", EntryPoint = "about")]

    public static extern int about();


 [DllImport("TSCLIB.dll", EntryPoint = "openport")]

    public static extern int openport(string printername);


 [DllImport("TSCLIB.dll", EntryPoint = "barcode")]

    public static extern int barcode(string x, string y, string type,

                string height, string readable, string rotation,

                string narrow, string wide, string code);


 [DllImport("TSCLIB.dll", EntryPoint = "clearbuffer")]

    public static extern int clearbuffer();


 [DllImport("TSCLIB.dll", EntryPoint = "closeport")]

    public static extern int closeport();


 [DllImport("TSCLIB.dll", EntryPoint = "downloadpcx")]

    public static extern int downloadpcx(string filename, string image_name);


 [DllImport("TSCLIB.dll", EntryPoint = "formfeed")]

    public static extern int formfeed();


 [DllImport("TSCLIB.dll", EntryPoint = "nobackfeed")]

    public static extern int nobackfeed();


 [DllImport("TSCLIB.dll", EntryPoint = "printerfont")]

    public static extern int printerfont(string x, string y, string fonttype,

                    string rotation, string xmul, string ymul,

                    string text);


 [DllImport("TSCLIB.dll", EntryPoint = "printlabel")]

    public static extern int printlabel(string set, string copy);


 [DllImport("TSCLIB.dll", EntryPoint = "sendcommand")]

    public static extern int sendcommand(string printercommand);


 [DllImport("TSCLIB.dll", EntryPoint = "setup")]

    public static extern int setup(string width, string height,

              string speed, string density,

              string sensor, string vertical,

              string offset);


 [DllImport("TSCLIB.dll", EntryPoint = "windowsfont")]

    public static extern int windowsfont(int x, int y, int fontheight,

     int rotation,  int fontstyle, int fontunderline,

                    string szFaceName, string content);

  

}



namespace TSCLIB_DLL_IN_C_Sharp

{

    static class Program

    {

        /// <summary>

        /// 應用程式的主要進入點。

        /// </summary>

        [STAThread]

        static void Main()

        {

            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new Form1());

        }

    }

}


 


 


//----Form1.cs


using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;


namespace TSCLIB_DLL_IN_C_Sharp

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }


        private void button1_Click(object sender, EventArgs e)

        {

            //TSCLIB_DLL.about();                                                                //Show the DLL version

            TSCLIB_DLL.openport("TSC TTP-344M Plus");                                          //Open specified printer driver

            TSCLIB_DLL.setup("100", "63.5", "4", "8", "0", "0", "0");                          //Setup the media size and sensor type info

            TSCLIB_DLL.clearbuffer();                                                          //Clear image buffer

            TSCLIB_DLL.barcode("100", "100", "128", "100", "1", "0", "2", "2", "Barcode Test"); //Drawing barcode

            TSCLIB_DLL.printerfont("100", "250", "3", "0", "1", "1", "Print Font Test");       //Drawing printer font

            TSCLIB_DLL.windowsfont(100, 300, 24, 0, 0, 0, "ARIAL", "Windows Arial Font Test"); //Draw windows font

            TSCLIB_DLL.downloadpcx("UL.PCX", "UL.PCX");                                        //Download PCX file into printer

            TSCLIB_DLL.sendcommand("PUTPCX 100,400,"UL.PCX"");                               //Drawing PCX graphic

            TSCLIB_DLL.printlabel("1", "1");                                                   //Print labels

            TSCLIB_DLL.closeport();                                                            //Close specified printer driver

           

        }

    }

}


 


 


//------ 另例


  [System.Runtime.InteropServices.DllImport("tsclib.dll")]

  private static extern void windowsfont(int a, int b, int c,int d,int e ,int f, string g ,string h);

  [System.Runtime.InteropServices.DllImport("tsclib.dll")]

  private static extern void openport(string printername);

  [System.Runtime.InteropServices.DllImport("tsclib.dll")]

  private static extern void closeport();

  [System.Runtime.InteropServices.DllImport("tsclib.dll")]

  private static extern void sendcommand(string command);

  [System.Runtime.InteropServices.DllImport("tsclib.dll")]

  private static extern void setup(string width,string height,string speed,string density,string sensor,string vertical,string offset);

  [System.Runtime.InteropServices.DllImport("tsclib.dll")]

  private static extern void clearbuffer();

  [System.Runtime.InteropServices.DllImport("tsclib.dll")]

  private static extern void printlabel(string Set,string Copy);



  private void button1_Click(object sender, System.EventArgs e)

  {

   openport("TSC TTP-343");

   setup("100","65","3","10","0","3","0");

   clearbuffer();

   windowsfont(50,30,70,0,0,0,"黑体","索书号:");

   printlabel("1", "1");

   closeport();

  }


 


 


 


#region 调用TSC打印机打印条码

        /// <summary>

        /// 调用TSC打印机打印条码

        /// </summary>

        /// <param name="title">打印的标题</param>

        /// <param name="barCode">打印的条码编号</param>

        public static void TSC(string title, string barCode)

        {

            // 打开 打印机 端口.

            TSCLIB_DLL.openport(p_port);

            // 设置标签 宽度、高度 等信息.

            // 宽 94mm  高 25mm

            // 速度为4

            // 字体浓度为8

            // 使用垂直間距感測器(gap sensor)

            // 两个标签之间的  间距为 3.5mm

            TSCLIB_DLL.setup("94", "25", "4", "8", "0", "3.5", "0");

            // 清除缓冲信息

            TSCLIB_DLL.clearbuffer();

            // 发送 TSPL 指令.

            // 设置 打印的方向.

            TSCLIB_DLL.sendcommand("DIRECTION 1");

            // 打印文本信息.

            // 在 (176, 16) 的坐标上

            // 字体高度为34

            // 旋转的角度为 0 度

            // 2 表示 粗体.

            // 文字没有下划线.

            // 字体为 黑体.

            // 打印的内容为:title

            TSCLIB_DLL.windowsfont(176, 16, 34, 0, 2, 0, "宋体", title);

            // 打印条码.

            // 在 (176, 66) 的坐标上

            // 以 Code39 的条码方式

            // 条码高度 130

            // 打印条码的同时,还打印条码的文本信息.

            // 旋转的角度为 0 度

            // 条码 宽 窄 比例因子为 7:12

            // 条码内容为:barCode

            TSCLIB_DLL.barcode("176", "66", "39", "130", "1", "0", "7", "12", barCode);


 


#region 请求sendcommand指令,打印二维码

           //功能:繪製QRCODE二維條碼

           //語法:

           //QRCODE X, Y, ECC Level, cell width, mode, rotation, [model, mask,]"Data string”

           //參數說明

           //X QRCODE條碼左上角X座標

           //Y QRCODE條碼左上角Y座標

           //ECC level 錯誤糾正能力等級

           //L 7%

           //M 15%

           //Q 25%

           //H 30%

           //cell width    1~10

           //mode  自動生成編碼/手動生成編碼

           //A Auto

           //M Manual

           //rotation  順時針旋轉角度

           //0 不旋轉

           //90    順時針旋轉90度

           //180   順時針旋轉180度

           //270   順時針旋轉270度

           //model 條碼生成樣式

           //1 (預設), 原始版本

           //2 擴大版本

           //mask  範圍:0~8,預設7

           //Data string   條碼資料內容

           #endregion

           string command = "QRCODE 176,8,Q,8,A,0,M2,S7,\"" + barCode + "\"";

           TSCLIB_DLL.sendcommand(command);


            // 打印.

            TSCLIB_DLL.printlabel("1", "1");

            // 关闭 打印机 端口

            TSCLIB_DLL.closeport();

        }

#endregion