تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
Your first line of C# code اكتب اول كود في السي شارب
#1
السلام عليكم
كل عام وأنتم بخير
الموضوع برمته منقول كما نوهت في المشاركة السابقة وسامحوني احب اللغة العربية كثيرا وعلى استعداد بإذن الله لمناظرة
اكبر دكاترة اللغة العربية وبثقة ! 
ولكني في مجال البرمجة خصوصا عندما تقابلني شاشة الكيمبيوتر احب ان اتعلم لغة اخرى كالانجليزية والاسبانية والبرتغالية
وهممت بالكورية لكني لم اجد لها معلما متواضعا !!! 
الان هذه المواضيع في الشي شارب ليست موجهة إلا للمبتدئين فيها امثالي بالفعل انا في محو الامية قد اجد من يأخذ بيدي وقد أجد من يسخر او يثبط الهمم لكنني ماض قدماً فالمرء متعلم حتى يموت
لم اجد برنامج قوياً تمت برمجته على البيسك مع حبي لها خصوصا انني في المحرر كأنني اتخاطب مع شخص عاقل وليس مع الة
If then
لكن الحب لا يغني عن في العلم شيئا .... يكفي هرج؟ طيب
الان Your first line of C# code
افتح الفيجوال واختر console application  اقل شي تابع الصور ترجمة جوجل تجيب المرض
[صورة مرفقة: program_tab.gif] 
For now, ignore the lines that start with using as we'll get to them later in the course. But they add references to in-built code. The namespace line includes the name of your application. A namespace is a way to group related code together. Again, don't worry about the term namespace, as you'll learn about these later.
The thing that's important above is the word class. All your code will be written in classes. This one is called Program (you can call them anything you like, as long as C# hasn't taken the word for itself). But think of a class as a segment of code that you give a name to.
Inside of the class called Program there is this code:
static void Main(string[ ] args)
{

}
This piece of code is something called a Method. The name of the Method above is Main. When you run your programme, C# looks for a Method called Main. It uses the Main Method as the starting point for your programmes. It then executes any code between those two curly brackets. The blue words above are all special words - keywords. You'll learn more about them in later chapters.
But position your cursor after the first curly bracket, and then hit the enter key on your keyboard:
The cursor automatically indents for you, ready to type something. Note where the curly brackets are, though, in the code above. You have a pair for class Program, and a pair for the Main method. Miss one out and you'll get error messages.
The single line of code we'll write is this (but don't write it yet):
Console.WriteLine("Hello C Sharp!");
First, type the letter "C". You'll see a popup menu. This popup menu is called the IntelliSense menu. It tries to guess what you want, and allows you to quickly add the item from the list. But it should look like this, after you have typed a capital letter "C":
[صورة مرفقة: code_console.gif]
The icon to the left of the word Console on the list above means that it is a Class. But press the Enter key on your keyboard. The word will be added to your code:
Now type a full stop (period) immediately after the word Console. The IntelliSense menu appears again:
[صورة مرفقة: code_console2.gif] 
You can use the arrow keys on your keyboard to move up or down the list. But if you type Writeand then the letter L of Line, IntelliSense will automatically move down and select it for you:
[صورة مرفقة: code_console3.gif] 
Press the Enter key to add the word WriteLine to your code:
Now type a left round bracket. As soon as you type the round bracket, you'll see this:
[صورة مرفقة: code_console4.gif] 
WriteLine is another Method (A Method is just some code that does a particular job). But the yellow box is telling you that there are 19 different versions of this Method. You could click the small arrows to move up and down the list. Instead, type the following:
"Hello C Sharp!"
Don't forget the double quotes at the start and end. These tell C# that you want text. Your code will look like this:
Now type a right round bracket:
Notice the red wiggly line at the end. This is the coding environment's way of telling you that you've missed something out.
The thing we've missed out is a semicolon. All complete lines of code in C# must end with a semicolon. Miss one out and you'll get error messages. Type the semicolon at the end and the red wiggly line will go away. Your code should now look like this:
Note all the different colours. Visual C# colour-codes the different parts of your code. The reddish colour between double quotes means that you want text; the green colour means it's a Class; blue words are ones that C# reserves for itself.
(If you want, you can change these colours. From the menu bar at the top, click Tools > Options. Under Environment, click Fonts and Colors.)
Time now to Build and Run your code!
طيب الان تالع كيف تبني هذا الكود اللي انت سويته
بالمناسبة الشرح تفصيلي فوق وممل  يتكلم حتى عن تعابير الالوان المختلفة
ما علينا نكمل مع الاجنبي هذا
How to Run your C# Program
كيف تشغل برنامجك؟
You can test your programme a number of ways. First, though, it has to be built. This is when everything is checked to see if there are any errors. Try this:
  • From the View menu at the top of Visual C# Express, click Output. You'll see a window appear at the bottom. (In C# 2010, if you can't see an Output entry, click the Tools menu. From the Tools menu, select Settings > Expert Settings. The Output menu item should then appear on the View menu.)

  • From the Build menu at the top of Visual C# Express, click Build Solution

  • You should see the following report:
The final line is this:
Build: 1 succeeded or up-to-date, 0 failed, 0 skipped
That's telling you that everything is OK.
Now try this:
  • Delete the semicolon from the end of your line of code

  • Click Build > Build Solution again

  • Examine the output window
This time, you should see these two lines at the end of the report:
Compile complete -- 1 errors, 0 warnings
Build: 0 succeeded or up-to-date, 1 failed, 0 skipped

So it's telling you that it couldn't build your solution because there was 1 error.
Put the semicolon back at the end of the line. Now click Debug from the menu at the top of Visual C# Express. From the Debug menu, select Start Debugging.
You should see a black DOS window appear and then disappear. Your programme has run successfully!
To actually see your line of text, click Debug > Start Without Debugging. You should now see this:
And that's your programme! Have a look at the Solution Explorer on the right. Because the project has been built, you'll see more files under Debug:
[صورة مرفقة: solution_explorer_debug.gif]
We now have a ConsoleApplication1.exe and ConsoleApplication1.pdb. The exe file is an executable programme, and it appears in the bin/debug folder. Switch back to Windows Explorer, if you still have it open. You'll see the exe file there:
You could, if you wanted, create a desktop shortcut to this exe file. When you double click the desktop shortcut, the programme will run.
But that's enough of Console Applications - we'll move on to creating Windows Applications.
اوكي الى هنا الرجال يقول هذا كافي في الكونسول وتعال نشتغل واجهات ويندوز
بالمناسبة الشرح على فيجوال استوديو  2010 وشكل الويندوز ملينيوم او 98
شايفين كيف احنا فالحين بس في اقتنا احدث الاجهزة والانظمة؟
Shy
الدرس القادم اول تطبيق على الويندوز فوم
تجده هنا

http://vb4arb.com/vb/thread-13298.html

ريقي نشف من كثر الهرج
في امان الباري
سبحان الله والحمدلله ولا إله إلا الله والله أكبر
 اللهم اغْفِرْ لِلمؤمنين والمؤمنات والمسلمين والمسلمات الأحياء منهم والأموات
الرد }}}
تم الشكر بواسطة: الشاكي لله , Sajad , Sajad


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  المتغيرات في السي شارب أبو عمر 4 10,336 17-01-23, 03:18 PM
آخر رد: vatedome04
  للمبتدئين في السي شارب _ كيفية الاتصال بقاعدة البيانات والتعامل معها أبو عمر 13 23,640 26-05-21, 03:27 PM
آخر رد: الياسين
  [درس فيديو] برمجه برنامج اداره مبيعات | سي شارب و LINQ kiki 2 7,030 10-05-21, 09:44 PM
آخر رد: ba2e44ca9a
  [C#.NET] دورة تصميم برنامج مبيعات احترافي باستخدام سي شارب C# and LINQ to SQL and Devexpress saidou23 3 10,379 13-03-21, 09:19 PM
آخر رد: bfdnfh
Photo [سلسلة تعليمية] دورة عمل مشروع مبيعات بلغة سي شارب باحترافية عالية (متجدد يوميا) عاصم النجار 9 9,330 08-12-20, 12:43 AM
آخر رد: عاصم النجار
Big Grin [C#.NET] دروس فيديو لتعليم سي شارب من البداية حتى الإحتراف باحطاب سوفت 9 13,593 16-10-18, 11:33 PM
آخر رد: nashaat
  [C#.NET] موقع دورة سي شارب مجانية الشاكي لله 6 9,320 17-11-17, 08:51 PM
آخر رد: قاسم
  دورة قواعد البيانات SQLite ولغة سي شارب المبرمج الطموح88 2 6,671 05-11-17, 11:34 PM
آخر رد: قاسم
Thumbs Up [سؤال] مشكلة في الكوكيز سي شارب ahmed b skafi 0 3,002 26-08-16, 12:58 AM
آخر رد: ahmed b skafi
  دورة قواعد البيانات MySQLولغة سي شارب المبرمج الطموح88 1 5,178 01-08-15, 08:15 AM
آخر رد: ابو ابراهيم

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم