2010年8月9日星期一

Patrik Age 1.5 养子十五岁



  • 导演:埃拉·列姆哈根 Ella Lemhagen
  • 主演:古斯塔·斯柯施卡 Gustaf Skarsgård ....Göran Skoogh / 托克尔·彼特森 Torkel Petersson ....Sven Skoogh / 托马斯·柳恩格曼 Thomas Ljungman ....Patrik
  • 语言:瑞典语
  • 片长:103 min | Canada:100 min (Toron
  • 上映日期:2008年
  • 制片国家/地区:瑞典
  • 又名:一岁半的帕特里克 / 领养风波 / Patrik Age 1.5 / Patrik, Age 1.5

  • 简介:

  • 电 影的开头,是瑞典一个居民区内的邻居聚会,男主角是两个新搬入社区的同志伴侣Goran和Sven。他们大大方方地出双入对,一栋房子,一片屋前花园,一 起共同面对左邻右舍,看上去其乐融融。他们接下来的梦想,就是共同收养一个宝宝,这就是电影片名《养子十五岁》的来历。

    电影中的他们要面对的最大挑战,是他们自己。他们和天底下所有已婚的夫妻伴侣一样争吵打架,怀疑嫉妒,分歧外遇,更加上阴差阳错,本来收养的1.5岁小婴儿Patrik被社会福利机构弄错了一个小数点,换成了15岁的恐同叛逆青少年Patrik,生活变得复杂又复杂。

    是Patrik的错么?很难这么说。Patrik不过是随着命运带来的一面镜子,照出了我们人类自身的缺陷。中产也好,小资也好,花园洋房,体面工作,幸 福婚姻,一旦遇到Patrik这样的一面镜子,就会发现,我们自己身上的软肋,历历可数,和其她人类同胞一样,一根不少。然而Patrik也照出了伴侣关 系的可贵和珍稀,让我们看到在我们自己面对人性弱点时,正是我们的爱人,伸出至为珍贵的援助之手。

    因为爱他,才有包容,因为爱他,人生才完整。


    ===============

    虽然是一部同志题材的故事片,但如果你不恐同, 那么你可以从中感受到爱, 感受包容, 感受现实的偏见, 感受自信和无助....

    另,我喜欢影片的音乐, 几首乡村歌曲很好听, 而片尾的"here you come again" 也非常动听.

    好的电影都有好的音乐, 至少他们选择一些很不错的音乐/歌曲.

    • "B.A.B.Y"
      Written by David Porter and Isaac Hayes
      Performed by Carla Thomas


    • "No One to Kiss"
      Written by Anna Järvinen
      Performed by The Kissin' Cousins


    • "Layin'Road"
      Written by Anna Järvinen
      Performed by The Kissin' Cousins


    • "Love me like you used to"
      Performed by Tanya Tucker


    • "Here You Come Again"
      Written by Mann / Weil
      Performed by Jessica Andersson

2010年8月5日星期四

USB keyboard disabled (USB 键盘失效)

打开注册表regedit,
定位到HKEY_LOCAL_MACHINE\SYSTEM\
CurrentControlSet\Control\Class\{4D36E96B-
E325-11CE-BFC1-08002BE10318}删除UpperFilters项
卸载设备,重新启动。

然后设备管理器里变成:代码 10:该设备无法启动。
定位到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-
E325-11CE-BFC1-08002BE10318}添加字符串UpperFilters项,内容是kbdclass
卸载设备,重新启动。

实际修复中,第二步没有出现“错误10”,
但我仍旧加上UpperFilters 这个注册值。

重启,OK。

如此果真键盘恢复使用了。至于为什么会发生这种问题,我还没仔细研究!

成瘾性药物

市面上常见的成瘾性药品包括:
含可待因的复方口服溶液;
麻黄碱苯海拉明片、茶碱麻黄碱片、复方茶碱麻黄碱片、
呋麻滴鼻液、复方甘草麻黄碱片、消咳宁片
复方氨酚苯海拉明片、
新康泰克等含麻黄碱复方制剂;复方地芬诺酯、复方甘草片
止痛片、右美沙芬片、晕动片以及解热镇痛药品种。

仅花七步!换主板不需要重装XP

好了,下面可以开始。

1.备份

对系统做任何大改变的时候都最好先备份一下你的重要文件,以免丢失。

2.卸载设备驱动

卸载“控制面板-》添加或删除程序”所有有关驱动的项目,然后重启(是删除所有驱动后再重启)。

3.禁用ACPI支持

进入设备管理器,选“计算机”,如图所示,更新驱动:

Advanced Configuration and Power Interface (ACPI) PC
选择: 更新驱动.再选择"从列表或指定位置安装(高级)

--不要搜索
[X]显示兼容硬件
点选: Standard PC

选择“Standard PC”后,系统会提示重启,记住选择“否”!因为我们要关机更换主板了。

4.更换主板,安装设备驱动

换好主板开机,正常进入WINDOWS,然后重新安装之前卸载的设备驱动,但这还没完。

5.删除之前的主板驱动

再次来到“设备管理器”,显示所有隐藏设备

所有的隐藏设备的图标都是半透明的,将除“非PnP驱动”(没有这选项就忽略)和“声音、视频和游戏控制器”以外的隐藏设备都删掉。6.重新打开ACPI支持

也就是将第三步的改变又改回来,再重启。


7.最后一步

按第五步的做法,再一次删除隐藏设备。

换主板后不用重装系统,是不是很方便呢?

2010年8月4日星期三

windows 7/Vista Remote Nero burning (远程桌面刻录)

如果你要通过remote desktop 调用远程的windows 7, Vista的系统中的NERO来刻录光盘(或类似的刻录程序). 可能会遇到 not been able to access my drives for burning due to Windows security restrictions.

解决办法:

In Group Policy Editor, go to Computer Configuration | Administrative
Templates | System | Remote Storage Access | All Removable Storage:
Allow direct access in remote sessions... set this to ENABLED.

HP laser jet 2055DN print Duplex/both/two sides 双面打印

2055DN在WINDOWS 7下安装驱动程序后,不能实现双面打印.

因为驱动不能自动更新设备状态. 所以需要自己调节:

On the driver "Printer Properties" dialogue, select the "Device Settings" tab (may only be available when logged in with administrative rights) and change the 'duplex unit' option from "Not installed" to "Installed".

在打印机属性-->设备设置-(可能需要管理员权限)-->双面打印单元--设置成"已安装".

学会12招 让你一生绝不得糖尿病

全世界得糖尿病的人越来越多,国际糖尿病协会去年10月宣布,这一数字已经达到2.85亿,到了面临失控的地步。中国的糖尿病患病率也在30年内翻了两番,成为世界糖尿病第二大国。造成这种状况的原因何在?美国《预防》杂志最近一篇文章指出,是因为大部分人没有学会在日常生活中控制血糖。其实,只要做到以下 12点,你的一生就绝不会得糖尿病。

吃肉前喝两勺醋大大降低血糖水平

1.吃肉前喝两勺醋。美国亚利桑那州立大学研究发现,吃大鱼大肉等高热量食物前喝两勺食醋,可大大降低血糖水平。如不习惯喝醋,最好饭前吃点放醋的凉拌菜。

2.减轻5%的体重。哪怕你非常肥胖,而且不锻炼,但只要体重减轻5%,患糖尿病的危险就会降低70%。

3.每天走路35分钟。芬兰研究发现,走路可让体内胰岛素得到最大效果利用。每周走路4小时,每天35分钟,可使糖尿病危险降低80%。

4.多喝咖啡。哈佛大学公共卫生学院研究发现,每天6杯咖啡,糖尿病危险降低29%—54%;每天4—5杯,降低约29%;但每天1—3杯则几乎不起作用。
5.买食物看清高纤维标志。有高纤维标志的食物,能确保其中至少含有5克粗纤维,可降低乳腺癌、糖尿病、高血压及中风危险。

6.一周吃快餐不超过2次。美国研究发现,每周吃快餐2次以上,身体器官对胰岛素的敏感性降低一倍。

7.火腿香肠要少吃。每周吃5次以上火腿或香肠,糖尿病危险会增加43%,罪魁祸首是加工肉食中的添加剂。专家建议,应偶尔吃肉,多吃蔬菜。

8.肉桂有助降血糖。德国科学家发现,肉桂有助于降血脂,进而防止糖尿病危险。肉桂粉可撒在咖啡里,也可以和蜂蜜一起冲水喝。
9.做事前3次深呼吸。长期压力会导致血糖升高。专家建议,做任何事情前最好都先做3次缓慢的深呼吸,以减小压力。

10.睡眠在6—8小时之间。睡眠经常不足6小时的人,糖尿病危险翻番;而睡眠超过8小时的人,糖尿病危险增加3倍。

11.不要独居。独居的人患糖尿病的风险比其他人高2.5倍。专家建议,即使独居也应保持健康生活方式。

12.45岁后多关注血糖。血糖指数为100—125毫克/分升的人,10年内最易发生糖尿病。专家建议,45岁后、肥胖者、有糖尿病家族史以及高胆固醇和高血压的人,应多关注血糖。

无法安装网卡,错误"The System Cannot Find the File Specified"

After I posted I kept Googling for info about the message "The System Cannot Find the File Specified", and I found the following posting:

http://www.quatech.com/support/rs422...pci_faq.php#16

Q17. When installing a product, I get an error message stating "The System Cannot Find the File Specified." How can I fix this?
A. Windows 2000/XP has a bug that it cannot properly detect new hardware by *.inf files, if the RunOnce registry key is missing.
This key is often used by installers to execute post-reboot programs, but sometimes they accidentally delete this key.

Go to Start ? Run and enter "regedit"
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
With CurrentVersion Highlighted, go to the Edit menu and select New ? Key
Name the key RunOnce - Leave everything else about the key alone.
The RunOnce key should now exist underneath the CurrentVersion key.
Reboot your PC.
Once the key exists, Windows 2000/XP stops redetecting the Hardware

I tried this and amazingly it fixed all my problems (the Dymo Label Printer, the Data Pilot USB cable, etc.) I can't believe it after days of trying everything and not getting a solution from Sony (the PC maker) or the software vendor.

I don't know how it happened that this registry key got deleted, but I'm sure happy that I found the posting.

Try it and see if it helps.
====================
简单的说,就是在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
下建一个RunOnce的键.

Windows 7 cannot access Windows XP (WIN7 无法访问XP)

XP 互通无误,连 Linux 都能访问目标 XP 机器,唯独 Win7 不行。
错误代码:0x80070035 找不到网络路径。

解决:
TCP/IP NetBIOS Helper
XP 访问共享并不需要该服务,所以长期一直禁用该服务未见异常。然而 Win7 需要,所以在禁用了 Win7 的 TCP/IP NetBIOS Helper 服务的情况下连自己的共享都不能访问,同样也无法访问禁用了 TCP/IP NetBIOS Helper 服务的 XP 。要用 Win7 去访问主机上的共享资源,必须要在服务端开启 TCP/IP NetBIOS Helper 服务。

换句话说,WIN7,XP都要开启TCP/IP NETBIOS HELPER.

2010年8月3日星期二

PerfMonCounterNotCorruptedCheck error in installation of SQL 2008

You can try to restore Performance Counters using the following command, it
may work.

lodctr /R:PerfStringBackup.INI

Also, take a look at the following link:
http://www.eukhost.com/forums/f31/fi...-express-4512/

在安装SQL server 2008 Express R2时,遇到如上错误,可以试一下前述的解决方法.

original URL:
http://www.phwinfo.com/forum/ms-sqlserver-setup/318646-perfmoncounternotcorruptedcheck-error-installation-sql-2008-a.html#post1427280

2010年8月2日星期一

MD5 asp.net unicode SQL server

In asp.net (C#) , all string are in unicode.

if you want to caculate a string's MD5 hash (ansi string submited from page), maybe you won't get the right result.

There is no way to deal with it within C# ( i haven't found way)

But if you want to use MD5 hash in SQL server, use stored procedure could slove this problem.

Param:
Declare @oldvar nvarchar(20)
Declare @newvar varchar(20)
select @newvar=oldvar would convert nvarchar into varchar

for detail, check this website:
http://weblogs.sqlteam.com/mladenp/archive/2009/04/28/Comparing-SQL-Server-HASHBYTES-function-and-.Net-hashing.aspx

Example in SQL Server

-- note the size 15 of all datatypes
declare @val1 varchar(15),
@val2 nvarchar(15),
@val3 char(15),
@val4 nchar(15)

-- example of 1 byte/char text
-- all variables are of same length
select @val1 = '1234567890',
@val2 = N'1234567890',
@val3 = '1234567890',
@val4 = N'1234567890'

-- all 4 return different results
select HASHBYTES('md5', @val1) as MD5_varchar, -- result = 0xE807F1FCF82D132F9BB018CA6738A19F
-- just to show that collation doesn't change the hash
HASHBYTES('md5', @val1 collate Cyrillic_General_BIN2) as MD5_varchar_collation, -- result = 0xE807F1FCF82D132F9BB018CA6738A19F
HASHBYTES('md5', @val2) as MD5_Nvarchar, -- result = 0xE15E31C3D8898C92AB172A4311BE9E84
HASHBYTES('md5', @val3) as MD5_char, -- result = 0x2120C3F3423F89BA8A65ABD933321884
HASHBYTES('md5', @val4) as MD5_Nchar -- result = 0x90DEF5840F3A31174CA44E2022F743B6

-- example of 2 bytes/char text
-- 中文 means Chinese in written text
-- converting 2 bytes/char text to varchar cuts the text in half
select @val1 = '中文', -- this cuts the text in half
@val2 = N'中文', -- this stores the whole text
@val3 = '中文', -- this cuts the text in half
@val4 = N'中文' -- this stores the whole text

-- all 4 return different results
select HASHBYTES('md5', @val1) as MD5_varchar, -- result = 0xEA03FCB8C47822BCE772CF6C07D0EBBB
HASHBYTES('md5', @val2) as MD5_Nvarchar, -- result = 0x73C6C8CD2F94355EF015E5265D5E65B1
HASHBYTES('md5', @val3) as MD5_char, -- result = 0xA13C45A38853677887B4839071537634
HASHBYTES('md5', @val4) as MD5_Nchar -- result = 0xEADEBD3BD72A481C43C828E0C550145C
The catch here is the data type difference. Nvarchar and nchar take twice more bytes to store data than varchar and char. Since char and nchar pad the right side of the string with spaces to fill the gap up to defined data type length the spaces are also used in MD5 calculation. A collation plays no part in calculating hash values since collations are only applied to sorts and comparisons.

However care must be taken with texts that need 2 bytes per char of storage space like Chinese text. Storing it in a varchar variable cuts it in half.

Example in .Net - C#

For generating MD5 hashes I’ve used the code from this site which turned up as the first result on Google for “MD5 in C#”:

public string GetMD5Hash(string input)
{
System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
//byte[] bs = System.Text.Encoding.ASCII.GetBytes(input);
//byte[] bs = System.Text.Encoding.UTF7.GetBytes(input);
//byte[] bs = System.Text.Encoding.UTF8.GetBytes(input);
byte[] bs = System.Text.Encoding.Unicode.GetBytes(input);
//byte[] bs = System.Text.Encoding.UTF32.GetBytes(input);
bs = x.ComputeHash(bs);
System.Text.StringBuilder s = new System.Text.StringBuilder();
foreach (byte b in bs)
{
s.Append(b.ToString("x2").ToLower());
}
string password = s.ToString();
return password;
}

// hashes for the simple “1234567890” text in all encodings
ASCII: e807f1fcf82d132f9bb018ca6738a19f
UTF7: e807f1fcf82d132f9bb018ca6738a19f
UTF8: e807f1fcf82d132f9bb018ca6738a19f
Unicode: e15e31c3d8898c92ab172a4311be9e84
UTF32: 6a57502c29a5081f03cb70e0ad38ecc7

// hashes for the complex “中文” text in all encodings
ASCII: ea03fcb8c47822bce772cf6c07d0ebbb
UTF7: eb02105e5c51a33f21e8da7f8102cfda
UTF8: a7bac2239fcdcb3a067903d8077c4a07
Unicode: 73c6c8cd2f94355ef015e5265d5e65b1


UTF32: 65fe91b81ed1107566f9f9f5ed4ccaf1

All strings in .Net store their chars in 2 bytes by default. When hashing values we have to take this into account and use proper text Encoding. .Net supports 5 encodings: ASCII (7 bits per char), UTF7 (7 bits per char), UTF8 (8 bits = 1 byte per char), Unicode (UTF-16) (16 bits = 2 bytes per char) and UTF32 (32 bits = 4 bytes per char).

For text with only first 127 chars in the ASCII table ASCII, UTF7 and UTF8 encodings all return the same hash, but with UTF16 and UTF32 comes endianness so they don’t return the same hash values. Also note that the ASCII and UTF7 encoding aren’t recommended to be used anymore except in legacy apps. UTF8 should be used instead.

For text with complex chars we have to use Unicode or UTF32 or we loose char information.

Putting .Net and SQL Server together

It turns out that such a simple thing as hashing can become a serious issue if we’re not careful. Trouble always awaits when dealing with text and encodings. :)

When using SQL Server’s varchar data type the .Net encoding to go with is UTF8 since it’s the fastest and most optimized of the three (ASCII, UTF7, UTF8). When using the nvarchar data type to go is Unicode (UTF16) but we also have to know the texts endianness to create correct hashes. UTF32 is practically useless in this case because SQL Server doesn’t have a data type that stores text in 4 bytes/char so we’ll never get the same results if we use it.

This advice only applies when creating hashes both in .Net and SQL server and comparing them. If we’re creating hashes in .Net and only store them in a database then we don’t have to worry about this.

=========================
examples by myself:

update computer set
md5machineid=SUBSTRING((master.dbo.fn_varbintohexstr(HASHBYTES('MD5',substring(MachineID,1,23)))),3,32)

stored procedure:
CREATE PROCEDURE CheckMachineID
-- Add the parameters for the stored procedure here
@MD5MachineID nvarchar(32),
@tmpRString nvarchar(32),
@MixedMD5MachineID nvarchar(32)

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @RString varchar(32)
select @RString=@tmpRString
select MachineID from computer
where MD5MachineID=@MD5MachineID and
SUBSTRING(
(master.dbo.fn_varbintohexstr(
HASHBYTES('MD5',MachineID+@RString))),3,32)=@MixedMD5MachineID
-- Insert statements for procedure here

END

String or binary data would be truncated. The statement has been terminated (COOKIE as SQL parameter)

in ASP.net when using cookie as SQL parameter. if you got "String or binary data would be truncated. The statement has been terminated"

This is probably your c# problem:
WRONG: Request.Cookies["OperatorID"].ToString()
RIGHT:Request.Cookies["OperatorID"].Value.ToString()

if you are not meet this problem with cookie, maybe your field is set too small. try bigger.

COOKIE作SQL参数时,要注意C#写时有.Value这一段.不然,就会出现上述的错误.

Hard Disk Physical Serial Number (delphi)

原贴: original http://www.delphi3000.com/articles/article_1164.asp?SK=

Most FAQ manuals recommend to use GetVolumeInformation for extracting of "harddisk serial number". But it is the volume serial number, not harddisk s/n. It is assigned and changed during formatting of partition. Some companies
use cloning tools for installing software on all new computers by copying
from the single harddisk to all another. Of course, volume serial numbers for these disks are identical.

Now you can get real serial number of IDE hardisk.
See also my articles on delphi3000:
1204 "IDE harddisk serial number (Part 2)"
1174 "SCSI-2 device serial number"

// Get first IDE harddisk serial number
function GetIdeSerialNumber : SerialNumber;
const IDENTIFY_BUFFER_SIZE = 512;
type
TIDERegs = packed record
bFeaturesReg : BYTE; // Used for specifying SMART "commands".
bSectorCountReg : BYTE; // IDE sector count register
bSectorNumberReg : BYTE; // IDE sector number register
bCylLowReg : BYTE; // IDE low order cylinder value
bCylHighReg : BYTE; // IDE high order cylinder value
bDriveHeadReg : BYTE; // IDE drive/head register
bCommandReg : BYTE; // Actual IDE command.
bReserved : BYTE; // reserved for future use. Must be zero.
end;
TSendCmdInParams = packed record
// Buffer size in bytes
cBufferSize : DWORD;
// Structure with drive register values.
irDriveRegs : TIDERegs;
// Physical drive number to send command to (0,1,2,3).
bDriveNumber : BYTE;
bReserved : Array[0..2] of Byte;
dwReserved : Array[0..3] of DWORD;
bBuffer : Array[0..0] of Byte; // Input buffer.
end;
TIdSector = packed record
wGenConfig : Word;
wNumCyls : Word;
wReserved : Word;
wNumHeads : Word;
wBytesPerTrack : Word;
wBytesPerSector : Word;
wSectorsPerTrack : Word;
wVendorUnique : Array[0..2] of Word;
sSerialNumber : Array[0..19] of CHAR;
wBufferType : Word;
wBufferSize : Word;
wECCSize : Word;
sFirmwareRev : Array[0..7] of Char;
sModelNumber : Array[0..39] of Char;
wMoreVendorUnique : Word;
wDoubleWordIO : Word;
wCapabilities : Word;
wReserved1 : Word;
wPIOTiming : Word;
wDMATiming : Word;
wBS : Word;
wNumCurrentCyls : Word;
wNumCurrentHeads : Word;
wNumCurrentSectorsPerTrack : Word;
ulCurrentSectorCapacity : DWORD;
wMultSectorStuff : Word;
ulTotalAddressableSectors : DWORD;
wSingleWordDMA : Word;
wMultiWordDMA : Word;
bReserved : Array[0..127] of BYTE;
end;
PIdSector = ^TIdSector;
TDriverStatus = packed record
// Error code from driver, or 0 if no error.
bDriverError : Byte;
// Contents of IDE Error register. Only valid when bDriverError is SMART_IDE_ERROR.
bIDEStatus : Byte;
bReserved : Array[0..1] of Byte;
dwReserved : Array[0..1] of DWORD;
end;
TSendCmdOutParams = packed record
// Size of bBuffer in bytes
cBufferSize : DWORD;
// Driver status structure.
DriverStatus : TDriverStatus;
// Buffer of arbitrary length in which to store the data read from the drive.
bBuffer : Array[0..0] of BYTE;
end;

var hDevice : THandle;
cbBytesReturned : DWORD;
ptr : PChar;
SCIP : TSendCmdInParams;
aIdOutCmd : Array [0..(SizeOf(TSendCmdOutParams)+IDENTIFY_BUFFER_SIZE-1)-1] of Byte;
IdOutCmd : TSendCmdOutParams absolute aIdOutCmd;

procedure ChangeByteOrder( var Data; Size : Integer );
var ptr : PChar;
i : Integer;
c : Char;
begin
ptr := @Data;
for i := 0 to (Size shr 1)-1 do
begin
c := ptr^;
ptr^ := (ptr+1)^;
(ptr+1)^ := c;
Inc(ptr,2);
end;
end;

begin
Result := ''; // return empty string on error
if SysUtils.Win32Platform=VER_PLATFORM_WIN32_NT then // Windows NT, Windows 2000
begin
// warning! change name for other drives: ex.: second drive '\\.\PhysicalDrive1\'
hDevice := CreateFile( '\\.\PhysicalDrive0', GENERIC_READ or GENERIC_WRITE,
FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_EXISTING, 0, 0 );
end
else // Version Windows 95 OSR2, Windows 98
hDevice := CreateFile( '\\.\SMARTVSD', 0, 0, nil, CREATE_NEW, 0, 0 );
if hDevice=INVALID_HANDLE_VALUE then Exit;
try
FillChar(SCIP,SizeOf(TSendCmdInParams)-1,#0);
FillChar(aIdOutCmd,SizeOf(aIdOutCmd),#0);
cbBytesReturned := 0;
// Set up data structures for IDENTIFY command.
with SCIP do
begin
cBufferSize := IDENTIFY_BUFFER_SIZE;
// bDriveNumber := 0;
with irDriveRegs do
begin
bSectorCountReg := 1;
bSectorNumberReg := 1;
// if Win32Platform=VER_PLATFORM_WIN32_NT then bDriveHeadReg := $A0
// else bDriveHeadReg := $A0 or ((bDriveNum and 1) shl 4);
bDriveHeadReg := $A0;
bCommandReg := $EC;
end;
end;
if not DeviceIoControl( hDevice, $0007c088, @SCIP, SizeOf(TSendCmdInParams)-1,
@aIdOutCmd, SizeOf(aIdOutCmd), cbBytesReturned, nil ) then Exit;
finally
CloseHandle(hDevice);
end;
with PIdSector(@IdOutCmd.bBuffer)^ do
begin
ChangeByteOrder( sSerialNumber, SizeOf(sSerialNumber) );
(PChar(@sSerialNumber)+SizeOf(sSerialNumber))^ := #0;
Result := PChar(@sSerialNumber);
end;
end;

// For more information about S.M.A.R.T. IOCTL see
// http://www.microsoft.com/hwdev/download/respec/iocltapi.rtf

// See also sample SmartApp from MSDN Knowledge Base
// Windows Development -> Win32 Device Driver Kit ->
// SAMPLE: SmartApp.exe Accesses SMART stats in IDE drives

// see also http://home.earthlink.net/~akonshin/
// IdeInfo.zip - sample delphi application using S.M.A.R.T. Ioctl API
// IdeInfo2.zip - sample delphi application using S.M.A.R.T. Ioctl API

// Notice:

// WinNT/Win2000 - you must have read/WRITE access right to harddisk
// (see article 1204 to get workaround for this problem).

// Win98
// SMARTVSD.VXD must be installed in \windows\system\iosubsys
// (Do not forget to reboot after copying)

G1 中国移动 GPRS设置

中国移动:
一、基本设置
方法:点“设置”--“无线控制”-“移动网络”-“接入点名称”
(setting--Wireless--Mobile Network---Access Point Name)
第一个:NET设置
name:cmnet
apn:cmnet
MCC:460
MNC:02 (联通貌似是01)
apn type: default(*这个很是重要的说)
其他不要填
第二个:(wap设置)
name:cmcc
apn:cmwap
proxy:10.0.0.172
port:80
MCC:460
MNC:02
apn type: default
其他不要填
第三个:(彩信接入)
name:cmcc mms
apn:cmwap
proxy:10.0.0.172
port:80
mmsc:
http://mmsc.monternet.com
mms proxy:010.000.000.172
mms port:80
MCC:460
MNC:02
apn type:mms

二、点APN,打开网络,如果不显示上网的“E”图标,可以直接按拨号键输入以下字符:
*#*#4636#*#* ,进去了点手机信息, 点击最下面的切换DNS检查按钮 使按钮旁边显示为0.0.0.0 allowed ,OK!

如果输入以上字符无效的话!请打开MEAU→设置→高级设置→手机信息→切换DNS检查 (安卓ROM亲身试过,其他ROM不知有没这功能)

设置APN的朋友 需要注意的是MNC 不要输入00,一定要输入02! 输入00的话会不可见的!
三、以上设置完毕后,在接入点选择WAP接入。

四、在打开APN,图标“E”应可见。

2010年8月1日星期日

Hidden field lost after submit/postback (asp.net)

Using hidden field to save value. But lost them after submited.

I found if you use HTML hidden field in asp.net, you have to add "name" tag manually.

With "Name" tag, your hidden field will be submitted with value.

HIDDEN FIELD必须使用NAME属性,不然,在提交时不会上传到服务器方,也就说会丢失.
在ASP.NET时,必须注意这点.