2019年7月29日 星期一

2019年7月25日 星期四

C#.NET 程式碼來修改登錄機碼

[電腦設定]手動移除新增/移除程式清單中的程式
http://short1003.pixnet.net/blog/post/185830056-%5B%E9%9B%BB%E8%85%A6%E8%A8%AD%E5%AE%9A%5D%E6%89%8B%E5%8B%95%E7%A7%BB%E9%99%A4%E6%96%B0%E5%A2%9E-%E7%A7%BB%E9%99%A4%E7%A8%8B%E5%BC%8F%E6%B8%85%E5%96%AE%E4%B8%AD%E7%9A%84%E7%A8%8B



http://gogorice.blogspot.com/2009/02/c-registry-key.html

https://alen1985.pixnet.net/blog/post/27591860-c%23.net-%E7%A8%8B%E5%BC%8F%E7%A2%BC%E4%BE%86%E4%BF%AE%E6%94%B9%E7%99%BB%E9%8C%84%E6%A9%9F%E7%A2%BC

http://myprogramlog.blogspot.com/2013/09/registry-key.html

https://blog.xuite.net/danny72.chen/blog/23113790-C%23+%E5%B0%8DReg%E8%AE%80%E5%8F%96%E3%80%81%E5%AF%AB%E5%85%A5

https://www.cnblogs.com/saper/archive/2008/11/07/1328546.html

https://createps.pixnet.net/blog/post/31882287-c%23-%E8%AE%80%E5%8F%96%E5%BB%BA%E7%AB%8B%E7%99%BB%E5%85%A5%E6%AA%94-record

https://dotblogs.azurewebsites.net/programmerfighting/2018/01/05/092756

https://dotblogs.com.tw/programmerfighting/2018/01/05/092756

https://blog.miniasp.com/post/2011/03/25/How-to-check-Web-environment-in-the-Class-Library

https://dotblogs.com.tw/brian/2012/10/25/78923

https://dotblogs.com.tw/kirkchen/archive/2009/12/16/12487.aspx

https://blog.miniasp.com/post/2009/10/23/How-to-avoid-Console-Application-or-WinForm-being-started-multiple-times

https://blog.xuite.net/linbty/worldknowledge/456204315-%E9%97%9C%E9%96%89+Windows+10+%E4%BD%BF%E7%94%A8%E8%80%85%E5%B8%B3%E6%88%B6%E6%8E%A7%E5%88%B6+%28+UAC+%29

https://pcuser.pixnet.net/blog/post/34340125-%E3%80%90win-10-%E7%B7%B4%E5%8A%9F%E5%9D%8A%E3%80%91windows-10-%E6%93%BE%E4%BA%BA-uac-%E5%BC%B7%E9%97%9C%E7%A7%98%E6%B3%95

2019年7月22日 星期一

新增移除程式 隱藏c#

https://tunecomp.net/remove-uninstall-entry/

https://www.sordum.org/11081/hide-from-uninstall-list-v1-0/

https://www.codeproject.com/Tips/782919/Get-List-of-Installed-Applications-of-System-in-Cs

https://blog.xuite.net/skhung/digilife/36581032-%E5%B0%87%E7%A7%BB%E9%99%A4%E7%A8%8B%E5%BC%8F%E4%B8%AD%E7%9A%84%E9%A0%85%E7%9B%AE%22%E6%9A%AB%E6%99%82%22%E9%9A%B1%E8%97%8F

32 位元:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
64 位元:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
依照以上的路徑可以找到相關機碼,一整個機碼資料夾刪除就不會再被OCS掃到了

***

https://stackoverflow.com/questions/200037/removing-entry-of-an-application-from-add-remove-programs-in-c-sharp

https://stackoverflow.com/questions/30067976/programmatically-uninstall-a-software-using-c-sharp

***

https://www.poftut.com/how-to-add-remove-delete-import-export-manage-registry-keys-from-command-line-in-windows/

https://www.oipapio.com/question-605953

https://stackoverflow.com/questions/7776345/exporting-registry-keys-to-a-reg-file-in-c-sharp

https://www.c-sharpcorner.com/UploadFile/f9f215/windows-registry/

https://stackoverflow.com/questions/16316827/how-to-export-a-registry-in-c-sharp

https://barryhungmvp.pixnet.net/blog/post/88133155-c%23---%E5%A6%82%E4%BD%95%E8%AE%80%E5%8F%96%E7%89%B9%E5%AE%9A%E4%BD%8D%E7%BD%AEregistry-key

2019年7月20日 星期六

利用T-SQL為一個已存在的Table 增加欄位或變更欄位

https://byron0920.pixnet.net/blog/post/96199374-%E5%88%A9%E7%94%A8t-sql%E7%82%BA%E4%B8%80%E5%80%8B%E5%B7%B2%E5%AD%98%E5%9C%A8%E7%9A%84table-%E5%A2%9E%E5%8A%A0%E6%AC%84%E4%BD%8D%E6%88%96%E8%AE%8A%E6%9B%B4

GridView資料列Row合併欄位

https://pramaire.pixnet.net/blog/post/31837470

using System;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;

namespace prjGridV
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection();
            SqlCommand cmd = new SqlCommand();
            conn.ConnectionString = WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString;
            conn.Open();
            cmd.Connection = conn;
            cmd.CommandText = "SELECT [U_NAME],[U_LEVEL] FROM [AMS00].[dbo].[UNIT] order by [U_LEVEL]";
            //cmd.Parameters.Clear();
            //cmd.Parameters.AddWithValue("",);
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = cmd;
            DataTable dt = new DataTable();
            da.Fill(dt);
            conn.Close();

            //string dr_U_NAME = "無任何資料1";
            //string dr_U_LEVE = "無任何資料2";
            //==========================================
            //if (dt.Rows.Count>0)
            //{
            //     dr_U_NAME = "";
            //     dr_U_LEVE = "";
            //    foreach (DataRow dr_data in dt.Rows)
            //    {
            //        dr_U_NAME += dr_data["U_NAME"].ToString();
            //        dr_U_NAME += "<br />";
            //        dr_U_LEVE += dr_data["U_LEVEL"].ToString();
            //        dr_U_LEVE += "<br />";
            //    }
            //}
            //Literal1.Text = dr_U_LEVE;
            //Literal2.Text = dr_U_NAME;
            //==========================================

            //事後加一筆=====================================
            //DataRow dr = dt.NewRow();
            //dr["U_NAME"] = "千機";
            //dr["U_LEVEL"] = 9;
            //dt.Rows.Add(dr);
            //==============================================
         
            GridView1.DataSource = dt;           
            GridView1.DataBind();
         
           
           
        }
     

        protected void Button2_Click(object sender, EventArgs e)
        {
            TableRow row = new TableRow();

            TableCell cell1 = new TableCell();
            cell1.Text = "表格第一列";
            row.Cells.Add(cell1);


            TableCell cell2 = new TableCell();
            cell2.Text = "表格第二列";
            //cell2.Font.Size = FontUnit.Large; //設定文字尺寸
            cell2.ForeColor = System.Drawing.Color.Blue; //設定文字顏色
            cell2.BackColor = System.Drawing.Color.Red; //設定文字顏色
            row.Cells.Add(cell2);


            TableCell cell3 = new TableCell();
            cell3.Text = "表格第三列";
            row.Cells.Add(cell3);

            //產生表格
            Table1.Rows.Add(row);
        }

        protected void GridView1_PreRender(object sender, EventArgs e)
        {
            int i = 1;
            foreach (GridViewRow gvItem in GridView1.Rows)
            {
                if (gvItem.RowIndex != 0)
                {
                    //比對如果名稱如果相同就合併(RowSpan+1)
                    if (gvItem.Cells[0].Text.Trim() == GridView1.Rows[(gvItem.RowIndex - i)].Cells[0].Text.Trim())
                    {
                        GridView1.Rows[(gvItem.RowIndex - i)].Cells[0].RowSpan += 1;
                        gvItem.Cells[0].Visible = false;
                        i = i + 1;
                    }
                    else
                    {
                        GridView1.Rows[(gvItem.RowIndex)].Cells[0].RowSpan += 1;
                        i = 1;
                    }
                }
                else
                {
                    gvItem.Cells[0].RowSpan = 1;
                }
            }
        }
    }
}

2019年7月19日 星期五

crystal的佈署安裝問題

1.crystal元件

1.1下載
https://drive.google.com/file/d/1oXHf_mfFKmjOoZ2A6mIKLeq7Ap1A04OU/view?usp=sharing
1.2加入參考


2.log4net問題
無法載入檔案或組件 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' 或其相依性的其中之一

*要下載32位元

https://drive.google.com/file/d/1V1J_DYADcxSz6F7yifc55PcHpPJGrLBP/view?usp=sharing

======================================================
其他參考下載路徑
https://www.tektutorialshub.com/crystal-reports/how-to-download-and-install-crystal-report-runtime/

2019年7月11日 星期四

2019年7月5日 星期五

SYSTEM.WINDOWS.FORMS.TIMER與SYSTEM.TIMERS.TIMER的區別


SYSTEM.WINDOWS.FORMS.TIMERSYSTEM.TIMERS.TIMER的區別
.NET Framework裡面提供了三種Timer

System.Windows.Forms.Timer
System.Timers.Timer
System.Threading.Timer
VS.Net 2005預設只有一個Timer控制項,但那是System.Forms.Timer控制項。如果要使用System.Timers.Timer的控制項,需要在工具箱上按一下右鍵,手動添加的步驟:工具箱按一下右鍵->Add Item->找到命名空間是System.Timers.Timer的控制項,將其選中,OK即可。

這裡簡單的介紹一下這兩種Timer的區別。

System.Windows.Forms.Timer是使用得比較多的TimerTimer Start之後定時(按設定的Interval)調用掛接在Tick事件上的EventHandler。在這種TimerEventHandler中可以直接獲取和修改UI元素而不會出現問題,因為這種Timer實際上就是在UI執行緒自身上進行調用的。也正是因為這個原因,導致了在TimerEventHandler裡面進行長時間的阻塞調用,將會阻塞介面回應的後果。下面是一個簡單的例子:
Timer timer1 = new Timer();
private void Form1_Load(object sender, EventArgs e)
{
    timer1.Interval = 3000;
    timer1.Tick += delegate(object o, EventArgs args)
    {
        DoWork();
    };
    timer1.Start();
}
private void DoWork()
{
    for (int i = 0; i < 10; i++)
    {
        System.Threading.Thread.Sleep(1000);
    }
}
在這個例子中,DoWork方法裡面將會阻塞10秒,在這10秒之內,UI將會失去回應。而通過使用System.Timers.Timer,就可以解決這個問題。因為System.Timers.Timer是在.NETThread Pool上面運行的,而不是直接在UI Thread上面運行,所以在這種TimerEventHandler裡面進行耗時較長的計算不會導致UI失去回應。

但是這裡有兩個地方需要注意:

一、因為一般來說System.Timers.Timer不是運行在UI Thread上面的,所以如果要在這種TimerEventHandler裡面更新UI元素的話,需要進行一次執行緒切換,在WinForm開發中一般通過UI元素的Invoke方法完成:

private void DoWork()
{
    for (int i = 0; i < 10; i++)
    {
        System.Threading.Thread.Sleep(1000);
    }
    this.Invoke(new UpdateUICallBack(UpdateUI));
}
private delegate void UpdateUICallBack();
private void UpdateUI()
{
}
二、System.Timers.Timer有一個PropertySynchronizingObject 。如果設置了這個Property(一般是某個Form),那麼之後對Timer掛接的EventHandler的調用將會在創建這個UI元素的執行緒上進 行(一般來說就是UI執行緒)。值得注意的是,如果你通過WinForm設計器把System.Timers.Timer拖放到Form上,那麼這個 Property將會自動被設置。此時這種Timer就和System.Windows.Forms.Timer的效果一樣:長調用將會阻塞介面。

總結:

System.Windows.Forms.Timer

1. 它是一個基於Form的計時器
2. 創建之後,你可以使用Interval設置Tick之間的跨度,用委託(delegatehook Tick事件
3. 調用StartStop方法,開始和停止
4. 完全基於UI執行緒,因此部分UI相關的操作會在這個計時器內進行
5. 長時間的UI操作可能導致部分Tick丟失

System.Timers.Timer

1. 用的不是Tick事件,而是Elapsed事件
2. System.Windows.Forms.Timer一樣,用StartStop方法
3. AutoReset屬性決定計時器是不是要發起一次事件然後停止,還是進入開始/等待的迴圈。System.Windows.Forms.Timer沒有這個屬性
4. 設置對於UI控制項的同步物件(synchronizing object),對控制項的UI執行緒發起事件

System.Windows.Forms.Timer 是對於使用者介面程式設計的比較顯然的選擇。而另外兩個之間的選擇就不是很明顯。如果必須在IContainer內,那麼就應該選擇 System.Timers.Timer。如果沒有用到System.Timers.Timer的特性,那麼建議選擇 System.Threading.Timer,因為它稍稍羽量級一些。

Timer 是先等待再執行,如果我們要達到先執行再等待的效果,設置 默認時間間隔Interval =100,或者更少為1(不能為0),之後再引發事件內更改 時間間隔Interval 為想要的值。

轉載自:http://www.cnblogs.com/lonelyxmas/archive/2009/10/27/1590604.html

IP 層的程式設計 - 使用 C#

http://ccckmit.wikidot.com/csharpip

HK”的日常之ARP断网攻击

HK”的日常之ARP断网攻击



https://drive.google.com/file/d/1f5jPOiPKJ7NEbMEXFNNZdVo3VZvDb8-O/view?usp=sharing

2019年7月3日 星期三

winpcap講解

https://www.itread01.com/content/1548987697.html

Winpcap網路程式設計一之前言,實驗要求,實驗目標

ads

駭客攻防技術實作與演練

https://drive.google.com/file/d/1K-_Mnk0FjikXzAY9CGFg8uVSdW2pxLpL/view?usp=sharing

Arp spoof / Dns spoof 文件解說

https://drive.google.com/file/d/1zGppvRct3_hZqBkue-mYsp13ayGhfGlv/view?usp=sharing


Use of “for (;;)” in a C# application?

https://stackoverflow.com/questions/4604500/use-of-for-in-a-c-sharp-application

內網- DNS 欺騙和ARP 欺騙詳解

內網- DNS 欺騙和ARP 欺騙詳解


https://soapffz.com/sec/23.html

ARP欺騙


理解DNS记录以及在渗透测试中的简单应用


https://www.freebuf.com/articles/web/190947.html


ARP and DNS Spoofing 影片簡介


Create Doss Attack Program In C#

https://www.youtube.com/watch?v=XXmdYM3ONa0

【VC++】Visual Studio编辑器“智能提示(IntelliSense)”异常的解决方案

https://blog.csdn.net/guduruyu/article/details/81607063

或點一下form再點一下檢視原始碼

2019年7月2日 星期二

網路規劃與管理 - CCNA 技術彙集:第四章 TCP/IP 協定與分析

http://www.tsnien.idv.tw/Manager_WebBook/chap4/4-2%20ARP%20%E5%8D%94%E5%AE%9A%E8%88%87%E5%88%86%E6%9E%90.html

C#通过Ping实现执行tracert命令并处理结果

http://www.what21.com/sys/view/csharp-net_12_1475289521944.html

路由查詢命令tracert的用法

https://kknews.cc/zh-tw/digital/gjro8g9.html

[c#]記一次實驗室局域網的ARP欺騙

https://www.cnblogs.com/fantacity/p/4792689.html

安裝
https://www.winpcap.org/install/default.htm


https://drive.google.com/file/d/1QBfoLvjmB49DKAotNP8zzv9E_s3TErJv/view?usp=sharing

含dll
https://drive.google.com/file/d/1bpXn7HyDR7xpuJPdMtgypcU0CL-TKKDx/view?usp=sharing

程式執行時問題




SharpPcap - A Packet Capture Framework for .NET


https://www.codeproject.com/Articles/12458/SharpPcap-A-Packet-Capture-Framework-for-NET#basicCap

https://drive.google.com/file/d/18CmaLM8ibN8NbvV9ssUyLVF2a5bP4aca/view?usp=sharing


以 SharpPcap 實作可收聽封包的 C# 程式

http://likewaylai.blogspot.com/2012/03/sharppcap-c.html

c#编写ARP欺骗,无法加载 DLL“wpcap”: 找不到指定的模块。loadlibrary("wpcap.dll")失败-找不到指定的模块




Arp Spoofing 欺騙攻擊-實作

http://ff320232.blogspot.com/2013/04/arp-spoofing.html

https://www.shs.edu.tw/works/essay/2012/03/2012032809264957.pdf

ARP Spoofing,講解

https://ithelp.ithome.com.tw/articles/10193536

https://docs.google.com/presentation/d/18ieZlqQ7Z3nnysVcfmrCb8AxB3_I8TunpPw4OF2D9v8/edit?usp=sharing


c# 寫的ARP攻擊器和ARP防火牆

https://www.cnblogs.com/zifeiniu/archive/2011/06/16/2083015.html

https://www.twblogs.net/a/5b810ffb2b71772165aad208

https://drive.google.com/file/d/1_0TRqrylHk8V_VCWm9pePRWAQxXmjHyL/view?usp=sharing


C# 獲取 ARP 對映

https://www.itread01.com/content/1545730217.html

https://codeday.me/bug/20180301/138362.html

ARP協議之跨網段和同網段

https://kknews.cc/other/bkp444j.html

https://kknews.cc/zh-tw/tech/p4okplp.html

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&...