עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ReadKey - כיצד אני בודק איזה מקש נלחץ? [C#]

Featured Replies

פורסם

בהקשר לשאלון האמריקאי שבנושא הקודם, כעת אני בשלב שאני מקבל את התשובה, ברצוני שלחצו A, B, C, D בהתאם לתשובה, ניסיתי למצוא בעצמי את התחביר אך ללא הצלחה. מהו התחביר לפעולה הנ"ל בעזרת המטודה ReadKey? תודה.

פורסם

ReadKey מחזיר לך אובייקט מסוג ConsoleKeyInfo, שנותן אינפורמציה לגבי המקש שנלחץ (איזה מקש נלחץ, איזה תו הוא מייצג, האם לחצת על alt/shift/ctrl). על מנת לדעת איזה מקש נלחץ, אתה צריך לגשת לשדה Key (מטיפוס ConsoleKey) של אותו אובייקט.

לדוגמה:


ConsoleKeyInfo cki;
cki = Console.ReadKey();

switch (cki.Key)
{
case ConsoleKey.A:
// some code
break;
case ConsoleKey.B:
// some other code
break;
case ConsoleKey.C:
// some other code
break;
case ConsoleKey.D:
// some other code
break;
default:
// some more code
}

הנה לינק לmsdn:

http://msdn2.microsoft.com/en-gb/library/system.consolekeyinfo.aspx

פורסם
  • מחבר

בדיוק מה שחיפשתי, אחלה, תודה :]

פורסם

ולהבא:

חיפוש ב-msdn בד"כ יביא לך תוצאות מתאימות (כולל דוגמה לשימוש).

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.