الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

اسم الكمبيوتر و ال BDE ?

مغلق
بدأه ماهر احمد في 9 نوفمبر 2004 · 2 رد · 592 مشاهدة · في لغة Delphi
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم .

انا مبرمج (C++Builder , Delphi)

اقوم باستخدام قوائم ال paradox عبر الشبكه المحليه .

عندما يقوم احد المستخدمين بعمل تعديل ما في record معين ويحاول مستخدم اخر عمل نفس العملية تظهر الرسالة - Record locked by "userName

سؤالي: هل يمكن معرفة اسم الكمبيوتر بحيث تظهر الرسالة -

" Record Locked by user on "ComputerName Station

بارك الله فيكم

اخوكم ماهر احمد

فلسطين - 49

#2

تستطيع بإستخدام GetComputerName :

شرح الداله :

Unit
Windows.Pas

Syntax
GetComputerName(
lpBuffer: PChar;  	{a pointer to a buffer that receives the computer name}
var nSize: DWORD  {the size of the lpBuffer} buffer
): BOOL;    {returns TRUE or FALSE}

Description
This function retrieves the Windows networking computer name for the current system. The function also can retrieve the required size of the buffer to store the computer name. When the nSize parameter is set to zero and the lpBuffer parameter is set to NIL, the function will return the required size of the lpBuffer in the nSize parameter.

Parameters
lpBuffer: A pointer to a null terminated string buffer receiving the computer name.

nSize: A variable that specifies the maximum length of the buffer pointed to by the lpBuffer parameter, in characters. This value should be at least MAX_COMPUTERNAME_LENGTH in size.

Return Value
If the function succeeds, it returns TRUE and the variable pointed to by the nSize parameter receives the number of characters copied to the buffer. If the function fails, it returns FALSE. To get extended error information, call the GetLastError function.

The Tomes of Delphi 3: Win32 Core API Help File by Larry Diehl

مثال على قراءة وتغيير إسم الجهاز :

 procedure TForm1.Button1Click(Sender: Tobject);
var
  ComputerName: array[0..MAX_COMPUTERNAME_LENGTH+1] of char;  // holds the name
  Size: Integer;                                              // holds the size
begin
  {initialize the computer name size variable}
  Size := MAX_COMPUTERNAME_LENGTH+1;

  {retrieve the computer name}
  if GetComputerName(ComputerName, Size) then

    Edit1.Text := StrPas(Computername)
  else Showmessage('Computer Name Not Found');
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  ComputerName: array[0..MAX_COMPUTERNAME_LENGTH+1] of char;  // holds the name
begin
  {copy the specified name to the ComputerName buffer}
  StrPCopy(ComputerName, Edit1.Text);

  {set the computer name}
  if SetComputerName(ComputerName) then

    ShowMessage('Computer Name Reset Setting will be used at next startup')
  else ShowMessage('Computer Name Not Reset');
end;

تم تعديل هذه المشاركة بواسطة ORWA في 9 نوفمبر 2004 في 12:32

#3

السلام عليكم

شكراً اخي عروه على جوابك .

لكن ما اريده ليس معرفة اسم الكمبيوتر المحلي بل اريد معرفة اسم الكمبيوتر عبر الشبكه (LAN) والذي يقوم باستعمال وغلاق record Lock في قائمة بيانات (Paradox Table )

اعني عندما يقوم احد المستخدمين بعمل تعديل ما في record معين عبر الشبكه اريد معرفة اسم الكمبيوتر الذي بستخدمه هذا المستخدم .

اعتقد يمكن عمل ذلك باستعمال Dbi functions مثل DbiGetNetUserName

المرافقه لل BDE لكنني لا اعرف كيفية عمل ذلك

شكراً على المساعدة

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…