Posted on 2005-04-11 12:32
大阿福 阅读(322)
评论(0) 编辑 收藏
windows develop:
1.System.Windows
1) MDI form:
2) Controls:
3) right mouse menu:
access system clipboad:
2.GDI+
System.Drawing
dumpbin.exe
DC -> Graphics
scale transform:
3. File System:
System.IO
1)file/dir: copy/move/delete/create
Directory/DirectoryInfo:
File/FileInfo:
2)read/write files:
Stream:
FileStream/Networkstream/MemoryStream/BufferedStream/CryptoStream
string handle:
string is fixed.
4. NetWork:
System.Net -> WinSocket API
TCP/IP -> Scoket IP:portnumber (80/25/110/21...) 1-1024
http:
smtp: RFC 822
helo servername
mail from:<email>
rcpt to:<target email>
data
.
pop3:
5.windows services:
process -> multi-services
1)Create window service project
2)Add onstart/onstop code
3)Add installer
4)use installutil.exe to install the service.
6. interaction with OS:
1).NET Framework: System.Diagnostics
monitor window services:
a)sockets -> 80(http)/25(smtp)
b)non-sockets -> monitor all threads of that process.
System.Security.Principle
bool returnValue = LogonUser(userName, domainName, Console.ReadLine(),
LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,
ref tokenHandle);
WindowsIdentity newId = new WindowsIdentity(dupeTokenHandle);
WindowsImpersonationContext impersonatedUser = newId.Impersonate();
// do something
impersonatedUser.Undo();
2)API
System.Runtime.InteropServices
platform invoke -> P/Invoke
Hook
3)COM
RCW: tlbimp.exe/vs.net
CCW: tlbexp.exe
4)WMI:windows management instrumentation
System.management
5)Access registry:
Serialization: DeSerialization -> binary/xml
object/objectRef -> stream.
1)allocate an unique ID for an object.
2)descript the relationships of all the objects
3)save object's memeber fields.
lab:
1. create file explorer.
2. create dotnet notepad that similiars to the windows's notepad
3. create SQL Management tools that allow us to monitor the size of database and log files.
4. create TcpServer that can get http header from client's IE.
April 16/17