1.開啟筆記本
 
2.填入以下內容:
taskkill /IM iexplore.exe

Domon 發表在 痞客邦 留言(0) 人氣()





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
using System.Net;

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


private void button1_Click(object sender, EventArgs e)
{
//發gmail需要 using System.Net; & using System.Net.Mail;
Send_Gmail(textBox1.Text, "測試主題", "收件人地址");
}



public void Send_Gmail(string msg, string mysubject, string address)
{
MailMessage mmsg = new MailMessage("寄件人地址", address);
mmsg.IsBodyHtml = true; //設定是否採用HTML格式
mmsg.BodyEncoding = Encoding.UTF8; //設定mail內容的編碼
mmsg.SubjectEncoding = Encoding.UTF8; //設定mail主旨的編碼
mmsg.Priority = MailPriority.Normal; //設定優先權 1.High 2.Normail 3.Low
mmsg.Subject = mysubject; // mail主旨
mmsg.Body = msg; //mail內容

SmtpClient MySmtp = new SmtpClient("smtp.gmail.com", 587); //允許程式使用smtp來發mail,並設定smtp server & port
MySmtp.Credentials = new NetworkCredential("帳號", "密碼"); //設定帳號與密碼 需要using system.net;
MySmtp.EnableSsl = true; //開啟SSL連線 (gmail體系須使用SSL連線)
MySmtp.Send(mmsg);

MySmtp = null; //將MySmtp清空
mmsg.Dispose(); //釋放資源










}

}

}





Domon 發表在 痞客邦 留言(0) 人氣()

Dear All,
 


using System;



using System.Collections.Generic;



using System.ComponentModel;



using System.Data;



using System.Drawing;



using System.Text;



using System.Windows.Forms;



using System.IO;



using System.Runtime.InteropServices;



using System.Net;



 



 



namespace WindowsFormsApplication5



{



    public partial class Form1 : Form



    {



        public Form1()



        {



            InitializeComponent();



        }



 



       



        [DllImport("user32.dll",CharSet = CharSet.Auto)]



        private static extern int SystemParametersInfo(int uAction,int uParam,string lpvParam ,intuWinlni);



 



        private void Form1_Load(object sender, EventArgs e)



        {



 



            WebClient WebWay = new WebClient();



            string url = "";    //圖片的url



            string NewFileName = ""; //圖片存檔於您的電腦時的新名稱   ※需適時加副檔名          



            string FilePath = @"D:\" + NewFileName;   //存檔路徑,理所當然...邏輯區與資料夾需都存在=_=



 



            WebWay.DownloadFile(url, FilePath);   //利用WebWay這個方法下載至本機  參數...(下載路徑,存檔路徑)



           



 



 



            if (File.Exists(FilePath))  //判別檔案是否存在於對應的路徑



            {



 



                int Desktop = 0;



 



                Desktop = SystemParametersInfo(201, FilePath, 0x1 | 0x2);  //存在成立,修改桌布  (uActuin 20 參數為修改wallpaper



 



            }



            this.Close();   //執行結束 自動關閉> w <



           



 



        }



    }



}

 

 

 

 

                                         ***** 記錄Domon的學習歷程*****


Domon 發表在 痞客邦 留言(0) 人氣()

如何製作 reg 檔 註冊檔 
使用 Regedit 來編輯 registry 是很方便的一件事, 我們常常看到 .reg 的檔案可以匯入新的機碼或值, 或是編輯已存在的值或是設成空白, 但似乎對移除該值或是該機碼則無法使用 .reg 的檔案來進行, 本篇文章旨在利用 .reg 檔即可做到 新增 / 移除 / 編輯 某值或機碼. 
.reg 檔內容撰寫要點: 
1. 第一行必須為 REGEDIT4 (必須大寫, 而且必須在第一行, 4 是 Windows 95/98/ME/NT, 5 是 Windows2000/XP), 看你使用的環境來選擇 REGEDIT4 或 Windows Registry Editor Version 5.00 
2. 第二行必須為空行(其實這行即使不空下來也沒有影響, 弟試過應該是沒有問題) 
3. 接下來的內容就是有關要加入或編輯的機碼及值 
3-1 機碼的寫法 [HKEY_LOCAL_MACHINE\SOFTWARE\TEST] 
3-2 值的寫法 "my name"="test" 其中字串(REG_SZ)不需要加上前綴字, 若是非字串則請參考: 
REG_BINARY-> hex 
REG_DWORD-> dword 
REG_EXPAND_SZ-> hex(2) 
REG_MULTI_SZ-> hex(7) 
如: "my binary"=hex:cc,1b,00,00,00,40,3d,68 
3-3 該機碼或值不存在, 則會新增, 存在的話, 則會覆蓋 
3-4 預設值的設法 @="default value", 使用 @ 符號 
3-5 特號注意, 若要用 \ 符號時, 請用 \\ 代替, 如 "my path"="C:\\" 
以上為一般的操作方法, 接下來要說明的是移除的作法, 
4. 移除機碼或值, 其實很簡單, 只要在該機碼前加上 - (減號) 或是值設為 - (減號) 即可如, 
移除機碼: 
[-HKEY_LOCAL_MACHINE\SOFTWARE\TEST] 
移除值: 
"my name"=- 
5. 可以雙擊該 .reg 檔即可順利匯入內容, 或是使用 regedit xxx.reg 的方式亦可, 加上 /s 的方式就以 slient mode 安裝入 registry 
範例檔:test.reg

Domon 發表在 痞客邦 留言(0) 人氣()

1
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。