Weil Jimmer's BlogWeil Jimmer's Blog


Category:VB.NET

Found 8 records. Now is Page 1 / 2.

日記程式 下載
No Comments

Published:
Updated:2017-05-19 19:36:11

獨特的加密,「寫日記程式」,免費下載與使用。

這是我親自開發的程式之一,也是我目前覺得寫得還算正式的產品。看網路上很多日記程式都很假,我用過,他們那些都是「假藉」有密碼的前提,實際上,只不過是封鎖了要讀取的地方而已,我也可以用筆記本打開那些日記檔案,結果發現都沒有「加密」!

沒有加密,那開啟的密碼也只是虛設了!趕快來使用本團隊研發出來最安全的日記程式!

主要功能說明:

一、自訂文字顏色屬性、置中、置左、置右,可以插入圖片,還有插入附件檔案(連同檔案一塊加密存成一個日記檔)。

二、支持自訂背景音樂,包括音樂列表循環播放,音量控制,自動播放、順序調整之類的。

三、日記列表方便管理,具有搜尋功能,重新命名、編輯列表,刪除檔案,讀取檔案…等。

四、真正具有加密/解密效果的日記,不必擔心日記外洩。即便獲取原始檔案,依舊無法解密,解密需要"密碼"。(如果忘記就永遠解不出來了)

五、會詳細的紀錄目前的時間、目前日記的字數、插入了多少圖片、多少檔案(甚至可以計算所有日記加起來的字數、圖片數、檔案數)。

六、可自訂背景圖片,背景顏色,文字顏色、打字框顏色……的。

*註一:日記程式的背景圖片和背景音樂都不會經過加密,只是把圖片和音樂檔移動到資料夾內而已。

*註二:日記程式所創之密碼Hash檔已被加密過,即便解密,也只是一長串被加鹽運算一萬次的密文,幾乎無從還原。

下載地址【一】:https://url.weils.net/p

下載地址【二】:http://cht.tw/h/7i19i


This entry was posted in Software, Free, Product, Tools, VB.NET By Weil Jimmer.

RichTextbox Scroll Smooth 平滑滾動 VB.NET
No Comments

Published:2015-05-13 19:22:04

簡言之,RichTextBox 若裡面包含圖片的話(比如用剪貼簿的方法貼上RTF格式圖片),滾動就會顯得很有問題,不管是用右邊的滾動條上鍵、下鍵移動,或是用滑鼠滾輪滾動,都會「快速跳躍圖片」,意指:把圖片當成「一行文字」看待,尤其是當圖片很長(Height大於RichTextBox的高)的時候,而且又多張圖片,快速滾動就有可能發生,但問題是,我去網路上查很多資料都沒查到有什麼方法可以修正,當然是希望能用一行Code,就解決這個問題,不然滾動圖片「咻」一下就不見了,已經滾到最下面了,根本爛透了。

本方法以Vb.net Code為例,原代碼從網路上查到是 C#.Net,但是原代碼是按下按鈕自動平滑滾到最下面,而我這個是依照滑鼠滾輪而去做上下正常平滑滾動,意思是指修正滑鼠的快速滾動問題,稍微修改了原代碼,原本想貼上引用的地址,不過都關掉網頁,懶得查記錄了,好吧,也算是原創,因為有些還是我自己再添加的。

要先創建一個 Timer,代碼中 ID 為「Scroll_timer」。其餘不解釋,看代碼就明白。

    Private min, max As Integer
    Private pos As Integer = 0
    Private endPos As Integer = 0
    Private Const SB_HORZ As Integer = &H0
    Private Const SB_VERT As Integer = &H1
    Private Const WM_HSCROLL As Integer = &H114
    Private Const WM_VSCROLL As Integer = &H115
    Private Const SB_THUMBPOSITION As Integer = 4
    Private Const WM_SETREDRAW As Int32 = &HB
    Private scroll_speed As Integer = 20

    Private Declare Function SetScrollPos Lib "user32" (hwnd As IntPtr, nBar As Integer, nPos As Integer, bRedraw As Boolean) As Integer
    Private Declare Function GetScrollPos Lib "user32" (hwnd As IntPtr, nBar As Integer) As Integer
    Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (hwnd As IntPtr, nBar As Integer, wParam As Integer, lParam As Integer) As Integer
    Private Declare Function GetScrollRange Lib "user32" (hwnd As IntPtr, nBar As Integer, ByRef lpMinPos As Integer, ByRef lpMaxPos As Integer) As Boolean
    Private Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr


    Private Sub Scroll_timer_Tick(sender As Object, e As EventArgs) Handles Scroll_timer.Tick

        GetScrollRange(RichTextBox1.Handle, SB_VERT, min, max)
        max = max - RichTextBox1.ClientSize.Height
        pos = GetScrollPos(RichTextBox1.Handle, SB_VERT)
        Debug.WriteLine("Max=" & max & "--Min=" & min & "--Current=" & pos)
        If Scroll_timer.Tag = "down" Then
            If (pos >= endPos) Then
                Me.Scroll_timer.Enabled = False
                Exit Sub
            End If
            If endPos >= max Then
                endPos = max
            End If
            pos = pos + scroll_speed
            SetScrollPos(RichTextBox1.Handle, SB_VERT, pos, True)
            PostMessage(RichTextBox1.Handle, WM_VSCROLL, SB_THUMBPOSITION + &H10000 * pos, 0)
        Else
            If endPos <= 1 Then
                endPos = 1
            End If
            If (pos <= endPos) Then
                Me.Scroll_timer.Enabled = False
                Exit Sub
            End If
            If (pos - scroll_speed) < 1 Then
                pos = 0
            Else
                pos = pos - scroll_speed
            End If
            SetScrollPos(RichTextBox1.Handle, SB_VERT, pos, True)
            PostMessage(RichTextBox1.Handle, WM_VSCROLL, SB_THUMBPOSITION + &H10000 * pos, 0)
        End If
    End Sub

    Private Sub RichTextBox1_MouseWheel_Click(sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RichTextBox1.MouseWheel
        Dim temp As HandledMouseEventArgs = e
        temp.Handled = True
        Dim temp_pos = GetScrollPos(RichTextBox1.Handle, SB_VERT)
        If Scroll_timer.Enabled = True Then
            temp_pos = endPos
        Else
        End If
        If e.Delta > 0 Then
            Debug.WriteLine("Scrolled up!" & e.Delta)
            GetScrollRange(RichTextBox1.Handle, SB_VERT, min, max)
            endPos = temp_pos - e.Delta
            If endPos <= 1 Then
                endPos = 1
            End If
            Debug.WriteLine(endPos)
            Scroll_timer.Tag = "up"
            Me.Scroll_timer.Enabled = True
        Else
            Debug.WriteLine("Scrolled down!" & e.Delta & "--Current: " & temp_pos)
            GetScrollRange(RichTextBox1.Handle, SB_VERT, min, max)
            max = max - RichTextBox1.ClientSize.Height
            If temp_pos + Math.Abs(e.Delta) >= max Then
                endPos = max - 1
            Else
                endPos = temp_pos + Math.Abs(e.Delta) - 1
            End If
            Debug.WriteLine(endPos)
            Scroll_timer.Tag = "down"
            Me.Scroll_timer.Enabled = True
        End If
    End Sub

 


This entry was posted in Functions, VB.NET By Weil Jimmer.

雙重緩衝DataGridView
No Comments

Published:2015-04-26 12:54:37

    Function DoubleBufferedx(ByVal dgv As DataGridView, ByVal setting As Boolean)
        Dim dgvType As Type = dgv.GetType()
        Dim pi As System.Reflection.PropertyInfo = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
        pi.SetValue(dgv, setting, Nothing)
        Return True
    End Function

僅此作為筆記。


This entry was posted in Functions, VB.NET By Weil Jimmer.

當重新調整表單大小時「有效」降低閃爍 C# VB.Net
No Comments

Published:
Updated:2015-04-26 12:43:59

從前,總是使用雙重緩衝,但是這方法不管用,閃爍還是嚴重!自從stackoverflow找到一個很棒的方法後!非常有效!僅此作為筆記。

protected override CreateParams CreateParams {
  get {
    CreateParams cp = base.CreateParams;
    cp.ExStyle |= 0x02000000;  // Turn on WS_EX_COMPOSITED
    return cp;
  }
}
Protected Overrides ReadOnly Property CreateParams() As CreateParams
    Get
        Dim params As CreateParams = MyBase.CreateParams
        params.ExStyle = params.ExStyle Or &H2000000
        Return params
    End Get
End Property

轉自:http://stackoverflow.com/questions/2612487/how-to-fix-the-flickering-in-user-controls


This entry was posted in General, Functions, VB.NET By Weil Jimmer.

PHP/VB__ASCII轉換器
No Comments

Published:
Updated:2017-01-16 18:55:54

關於這點,真的是有夠麻煩的,我經常寫php,php通常UTF-8的網頁都是 "一個中文字"

轉成三個Ascii碼,現在才開始研究,到底要怎樣才可以像 VB 一樣 轉成 5位數的代碼。

又或者 VB 轉成 UTF-8形式的 3 個 ASCII。

好吧,結果出來了。

Unicode 介於 2048(800) ~ 65535(ffff) 之間:

套用形式:

1110****

10******

10******

比如:「我」,Unicode 為 25105 (6211),介於上述的情況。

所以:轉成 2進位 110001000010001

切成 三等分,第一等分 四位數,第二等分 六位數,第三等份六位數。不足則補0。

所以變成 0110001000010001,切割後變成:

0110

001000

010001

套進去變成

11100110

10001000

10010001

轉回 10 進位:

230

136

145

形成 UTF8形式的 三個ASCII碼。

另外,介於 128(80) ~ 2047(7ff) 間 則是另一個形式。

110*****

10******

大概就這樣。

有夠複雜的。

其實網頁 也可以 直譯 ASCII碼。

&#65;&#66;&#67;

ABC

&#36889;&#26159;&#28204;&#35430;

這是測試

我自己本身也寫了 PHP函數 轉 成 像 VB那樣的UTF16

function string_to_utf16_ascii_HTML($str){
	for ($i=0;$str[$i]!="";$i++){
		$b[]=ord($str[$i]);
	}
	$str2=';&#';
	for ($i=0;$str[$i]!="";$i++){
		$xa=str_pad(decbin($b[$i]),8,'0',STR_PAD_LEFT);
		if (substr($xa,0,3) == "110"){
			$xb=str_pad(decbin($b[$i+1]),8,'0',STR_PAD_LEFT);
			$xx1=substr($xa,3);
			$xx2=substr($xb,2);
			$c=$c.$str2.bindec($xx1.$xx2);
		}elseif (substr($xa,0,4) == "1110"){
			$xb=str_pad(decbin($b[$i+1]),8,'0',STR_PAD_LEFT);
			$xc=str_pad(decbin($b[$i+2]),8,'0',STR_PAD_LEFT);
			$xx1=substr($xa,3);
			$xx2=substr($xb,2);
			$xx3=substr($xc,2);
			$c=$c.$str2.bindec($xx1.$xx2.$xx3);
		}elseif (substr($xa,0,2) == "10"){
		}else{
			$c=$c.$str2.$b[$i];
		}
	}
	return substr($c,1);
}

再次更新,這個PHP代碼速度更快。

function string_to_utf16_ascii_HTML($str){
	for ($i=0;$i<strlen($str);$i++){
		$k=ord($str[$i]);
		if ($k >= 192 and $k <= 223){
			$k=$k-192;
			$k2=ord($str[$i+1])-128;
			$c=$c.'&#'.str_pad($k*64+$k2,5,'0',STR_PAD_LEFT).';';
		}elseif ($k >= 224 and $k <= 239){
			$k=$k-224;
			$k2=ord($str[$i+1])-128;
			$k3=ord($str[$i+2])-128;
			$c=$c.'&#'.str_pad($k*4096+$k2*64+$k3,5,'0',STR_PAD_LEFT).';';
		}elseif ($k >= 128 and $k <= 191){
		}else{
			$c=$c.'&#'.str_pad($k,5,'0',STR_PAD_LEFT).';';
		}
	}
	return $c;
}

又寫了等價VB的ChrW於PHP版。

function ChrW($str){
	$str=intval($str);
	$binnum=decbin($str);
	if ($str<=255){ return chr($str); }elseif($str>=256 and $str<=2047){
		$binnum=str_pad($binnum,11,'0',STR_PAD_LEFT);
		$x1=bindec('110'.substr($binnum,0,5));
		$x2=bindec('10'.substr($binnum,5,6));
		return chr($x1).chr($x2);
	}else{
		$binnum=str_pad($binnum,16,'0',STR_PAD_LEFT);
		$x1=bindec('1110'.substr($binnum,0,4));
		$x2=bindec('10'.substr($binnum,4,6));
		$x3=bindec('10'.substr($binnum,10,6));
		return chr($x1).chr($x2).chr($x3);
	}
}

By Weil Jimmer


This entry was posted in Functions, PHP, VB.NET By Weil Jimmer.

 1 2 /2 頁)下一頁

Visitor Count

pop
nonenonenone

Note

快訊:中華民國106年5/24
同性戀合法

歡迎前來本站。

Search

Republic Of China
Taiwan is a sovereign independent country, not a province of People's Republic of China.

We are "Republic of China (ROC)".

Communist Party of China is illegal and slaving people of China.
Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

The Lie We Live

youtube

The Questions We Never Ask

youtube

Support The Zeitgeist Movement

The Zeitgeist Movement

Man

youtube

In The Fall

youtube

Facebook is EATING the Internet

Facebook

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1NRMVGGpm2T1pmeejisLSEhCXfCefEW9V4

Recent Comments

sickcatail on STEAM免費序號

包包 on STEAM免費序號

問問題 on 最棒的手機通訊軟體 Telegram

unocme on STEAM免費序號

窩仔 on STEAM免費序號

Categories

Announcement (3)

Bash (1)

C (1)

C# (4)

C++ (1)

Experience (37)

Flash (2)

Free (10)

Functions (35)

Games (13)

General (42)

HTML (7)

Java (12)

JS (7)

Mood (23)

Note (23)

Office (1)

PHP (9)

Privacy (2)

Product (9)

Python (4)

Software (8)

The Internet (14)

Tools (12)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)