2012/09/25

Indy10 IdHTTP對非英文語的處理方式(泛中文處理)

這陣子想從網路上下載一些文件,URL大致上像下面這句:

「sUrl := http://www.DelphiCpp.com/我愛Delphi.txt」

使用 IdHTTP.Get(sUrl, ms) 方法卻怎麼也抓不到,可是也沒有Exception…

李組長眉頭一皺,發現案情並不單純。

於是請了Google大神拜了一下,也發現不少災情。

请问Delphi7怎么解决Indy发送中文字符的问题
Thread: IdHTTP and æøå ??

發現共通點都是靠「TIdTextEncoding」來解決問題
所以原先的作法就修改成這樣:

新書推薦 - Delphi XE2 Foundations (Delphi XE2 基礎)

以下是原文介紹
======================
Provides a comprehensive guide to the language and core non-visual libraries of Embarcadero Delphi XE2,
from basic language syntax to multithreading.

Adopting an integrated approach, the book covers both newer and older features alongside one another;
while it won't teach you how to program, it assumes little Delphi knowledge specifically.

Includes coverage of XE2's support for Mac OS X.

(Edition note: the printed version combines the three parts of the eBook version, which is available separately.)

如果手上有Kindle的人也可以考慮買Kindle Edition

不知道怎麼買的人也可以到這裡購買

天瓏

Amazon Delphi XE2 Foundations part1 for Kindle Edition

2012/08/20

IE Table 專用的 "bordercolordark" 和 "bordercolorlight"

 參考了以下的網頁:
http://w3help.org/zh-cn/causes/BT3003
http://help.dottoro.com/lhcrketd.php

知道這兩個屬性是IE專用的屬性,微軟也說不要再用它了,但卻也沒提到如何解決。

所以參考了 Dorroto 網頁的寫法:
// top right bottom left
    // blue cyan cyan blue
<table style="border:4px solid; border-color:#0000FF #00ffff #00ffff #0000FF;">
    <tr>
        <td onclick="ChangeBorder ();">Click this text!</td>
    </tr>
</table>


border-color 的配置順序是:上 左 下 右
所以要達成配色的話會是:色1 色2 色2 色1

但TD標籤並不會影響,那怎麼辦呢?

所以還需要再加上

<td style="border-color:#00FFFF #0000FF #0000FF #00FFFF;">Click this text!</td>
也就是反過來:色2 色1 色1 色2

2012/08/01

[轉]SQL SERVER 2000 事件探查器无法暂停及停止的解决办法

http://servicehome.ufida.com.cn/space/viewspacepost.aspx?postid=387
http://www.zu14.cn/2010/06/29/sql-server-profiler-can-not-stop-or-pause/

SQL SERVER事件探查器虽好用,可有的服务器上会出现针对本地数据库(local)启动事件探查器后无法暂停及停止的问题(一旦暂停或停止就长时间没响 应),出现这个问题主要原因是由于事件探查器默认使用安装SQL SERVER时记录下来的本地计算机名来访问本地数据库,一旦安装SQL SERVER后修改了计算机名,就会出现事件探查器能启动不能停止的问题。

   治标的解决办法:使用计算机名或IP来使用事件探查器连接数据库,而非用(local),则能正常暂停及停止了。

   治本的解决办法:更新SQL SERVER中记录的计算机名。打开master数据库的sysservers表,修改srvname字段及datasource字段为当前计算机名(由 于是系统表,默认不允许修改,所以修改前需要先进行设置:在企业管理器中的(local)节点点鼠标右键,“属性”-“服务器设置”,勾选“服务器行为”中的“允许对系统目录直接进行修改”)。

2012/07/30

ProcessInfo 1.5 is released with Win64 support

想取得程序的Handle等其它資訊還蠻好用的

ProcessInfo 1.5 is released with Win64 support

Posted on September 12th, 2011 Ali Keshavarz 5 comments
ProcessInfo 1.5 is released. The changes in this release are:
  • Added support for Win64 and Delphi XE2.
  • Added TProcessItem.CloseProcess method to close a process normally (not forcefully).
  • Added TProcessItem.CurrentProcess property. This property always refers to the current process in the list of running processes.
  • Added PrivateWorkingSetSize property to TProcessItem.MemoryInfo.
  • Added global  ProcessInformation function. This function returns a global instance of TProcessInfo. The instance will be freed when the application is terminating.
  • Fixed a few minor bugs.
To download ProcessInfo 1.5, please go to ProcessInfo page.


2012/07/25

SQL Server月份相減跨年度的計算方法

SET @YY='2012'
SET @MM='03'
SET @MM=@MM - 5

  IF @MM <= 0
  BEGIN
      SET @YY=@YY - 1
      SET @MM=@MM + 12
  END

雖然好像有更好的作法,但找到之前還是將就點吧