得到本地系統的語言 TZ

2021-04-01 09:59:56 字數 864 閱讀 8937

windows api

int getlocaleinfo(

lcid locale, // locale identifier

lctype lctype, // type of information

lptstr lplcdata, // address of buffer for information

int cchdata  // size of buffer

);可以用來獲得系統資訊比如系統語言,

function tform1.getlocaleinformation(flag: integer): string;

var

pclca: array[0..20] of char;

begin

if( getlocaleinfo(locale_system_default,flag,pclca,19) <= 0 ) then begin

pclca[0] := #0;

end;

result := pclca;

end;

procedure tform1.button1click(sender: tobject);

begin

showmessage(getlocaleinformation(locale_senglanguage));

end;

引數"flag"可以取下列值:

locale_ilanguage

locale_slanguage

locale_senglanguage

locale_sabbrevlangname

locale_snativelangname

關於accept得到的socket本地埠

伺服器端accept得到的socket本地埠就是listen埠 客戶端如果不指定會隨機一個本地埠 因此伺服器端沒有連線數量的限制 硬體無限 客戶端最多不能超過65533個連線 今天與同學爭執一個話題 由於socket的accept函式在有客戶端連線的時候產生了新的socket用於服務該客戶端,那麼,...

C庫得到系統當前的時間

include include include static time t end time intmain endif time end time 得到當前從1970開始的時間 crtimp struct tm cdecl mingw nothrow localtime const time t ...

Windows XP中如何找回丟失的系統語言欄

預設情況下,windows工作列上有一個輸入法標誌,在windows 98中被稱作輸入法圖示,在windows xp中被稱為語言欄。有時這個輸入法語言欄會突然丟失,在windows 98中,可以在 開始 執行 中輸入internat來恢復該標誌。在windows xp中該如何恢復呢?請看下面的方法 ...

得到系統程序和結束某個指定的程序

看到這篇文章,關閉指定的ie例項 自己想了另一個辦法來作 先修改登錄檔 hkey local machine system currentcontrolset service perfproc performance 下的 disable performance counters 的值改為0 得到系...

VC中得到當前系統的時間和日期

得到時間的方法一般都是得到從1900年0點0分到現在的秒數,然後轉為年月日時分秒的形式得到當前的時間 時分秒 主要方法如下 1 使用crt函式 char szcurrentdatetime 32 time t nowtime struct tm ptm time nowtime ptm localt...