windows上php連sybase會出現亂碼時,可依下列說明修改sybase client字元集。
1. 開啟SYBASE的安裝目錄的locales目錄中的locales.dat (C:\sybase\locales\locales.dat)
2. 依下列說明修改
[NT]
locale = enu, us_english, iso_1
locale = fra, french, iso_1
locale = deu, german, iso_1
locale = rus, russian, cp1251
locale = hun, us_english, cp1250
locale = ell, us_english, cp1253
locale = heb, us_english, cp1255
locale = ara, us_english, cp1256
locale = trk, us_english, cp1254
locale = esp, spanish, iso_1
locale = jpn, japanese, sjis
locale = japanese, japanese, sjis
locale = chs, chinese, eucgb
locale = cht, tchinese, big5
; locale = kor, korean, eucksc
locale = us_english.utf8, us_english, utf8
locale = default, us_english, iso_1(可改成utf8或其它,如:locale = default, us_english, utf8)
2011年9月21日 星期三
2011年5月22日 星期日
ubuntu安裝amule-daemon
1. 安裝amule-daemon
$sudo apt-get install amule-daemon
2.安裝amule-gnome-support
$sudo apt-get install amule-gnome-support
3. 設定amule-daemon
$sudo vim /etc/default/amule-daemon
# Configuration for /etc/init.d/amule-daemon
# The init.d script will only run if this variable non-empty.
AMULED_USER="使用者"
# You can set this variable to make the daemon use an alternative HOME.
# The daemon will use $AMULED_HOME/.aMule as the directory, so if you
# want to have $AMULED_HOME the real root (with an Incoming and Temp
# directories), you can do `ln -s . $AMULED_HOME/.aMule`.
AMULED_HOME="/home/使用者"
4. 產生MD5編碼後之密碼
$echo -n 你的密碼 | md5sum | cut -d ' ' -f 1
5. 設定remote.conf
$cd /home/使用者目錄/.aMule/
$amuleweb -w
$vim remote.conf
Locale=
[EC]
Host=localhost
Port=4712
Password=編譯後的密碼
[Webserver]
Port=4711
UPnPWebServerEnabled=0
UPnPTCPPort=50001
Template=php-default
UseGzip=0
AllowGuest=0
AdminPassword=編譯後的密碼
GuestPassword=編譯後的密碼
6. 設定vim amule.conf
$vim amule.conf [ExternalConnect]
UseSrcSeeds=0
ShowPercent=1
ShowProgressBar=1
AcceptExternalConnections=1
ECPassword=編譯後的密碼
ECAddress=
ECPort=4712
UPnPECEnabled=0
IpFilterClients=1
IpFilterServers=1
UseSecIdent=1
[WebServer]
Enabled=1
Port=4711
UPnPWebServerEnabled=0
WebUPnPTCPPort=50001
PageRefreshTime=120
UseGzip=1
UseLowRightsUser=0
Password=編譯後的密碼
PasswordLow=
Template=default
7. 重新啟動amule-daemon
$sudo /etc/init.d/amule-daemon restart
8.連線
http://主機IP:4711
$sudo apt-get install amule-daemon
2.安裝amule-gnome-support
$sudo apt-get install amule-gnome-support
3. 設定amule-daemon
$sudo vim /etc/default/amule-daemon
# Configuration for /etc/init.d/amule-daemon
# The init.d script will only run if this variable non-empty.
AMULED_USER="使用者"
# You can set this variable to make the daemon use an alternative HOME.
# The daemon will use $AMULED_HOME/.aMule as the directory, so if you
# want to have $AMULED_HOME the real root (with an Incoming and Temp
# directories), you can do `ln -s . $AMULED_HOME/.aMule`.
AMULED_HOME="/home/使用者"
4. 產生MD5編碼後之密碼
$echo -n 你的密碼 | md5sum | cut -d ' ' -f 1
5. 設定remote.conf
$cd /home/使用者目錄/.aMule/
$amuleweb -w
$vim remote.conf
Locale=
[EC]
Host=localhost
Port=4712
Password=編譯後的密碼
[Webserver]
Port=4711
UPnPWebServerEnabled=0
UPnPTCPPort=50001
Template=php-default
UseGzip=0
AllowGuest=0
AdminPassword=編譯後的密碼
GuestPassword=編譯後的密碼
6. 設定vim amule.conf
$vim amule.conf [ExternalConnect]
UseSrcSeeds=0
ShowPercent=1
ShowProgressBar=1
AcceptExternalConnections=1
ECPassword=編譯後的密碼
ECAddress=
ECPort=4712
UPnPECEnabled=0
IpFilterClients=1
IpFilterServers=1
UseSecIdent=1
[WebServer]
Enabled=1
Port=4711
UPnPWebServerEnabled=0
WebUPnPTCPPort=50001
PageRefreshTime=120
UseGzip=1
UseLowRightsUser=0
Password=編譯後的密碼
PasswordLow=
Template=default
7. 重新啟動amule-daemon
$sudo /etc/init.d/amule-daemon restart
8.連線
http://主機IP:4711
2011年3月1日 星期二
C# 連Sybase設定
C#連Sybase的方法:(目前只用過ADO.NET)
一、ADO.NET(用Sybase.Data.AseClient 連接)
1. 須先安裝sybase open client軟體(執行端也須安裝),安裝時請加選ADO.NET。
一、ADO.NET(用Sybase.Data.AseClient 連接)
1. 須先安裝sybase open client軟體(執行端也須安裝),安裝時請加選ADO.NET。
2. 至C:\sybase\ADO.NET\dll目錄中把Sybase.Data.AseClient.dll sybdrvado11.dll sybdrvssl.dll三個文件Copy到bin資料夾中,並在參考中加入Sybase.Data.AseClient.dll 。
3. 使用範例
using Sybase.Data.AseClient;
AseConnection aseCon ;
aseCon = new AseConnection("DataSource=127.0.0.1;Port=5000;Database=資料庫;UID=帳號;PWD=密碼;charset=utf8");
aseCon.Open();
AseCommand dcom = new AseCommand("SELECT name FROM student", aseCon);
AseDataReader dr = dcom.ExecuteReader();
dr.Read();
Console.WriteLine("name : " + dr[0].ToString());
dr.Close();
aseCon.Close();
3. 使用範例
using Sybase.Data.AseClient;
AseConnection aseCon ;
aseCon = new AseConnection("DataSource=127.0.0.1;Port=5000;Database=資料庫;UID=帳號;PWD=密碼;charset=utf8");
aseCon.Open();
AseCommand dcom = new AseCommand("SELECT name FROM student", aseCon);
AseDataReader dr = dcom.ExecuteReader();
dr.Read();
Console.WriteLine("name : " + dr[0].ToString());
dr.Close();
aseCon.Close();
訂閱:
文章 (Atom)