BEGINPROGRAMMER Telegram 461
إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

شرح استخدام try & catch

#try_and_catch
هي كلمات رئيسية تمثل معالجة الاستثناءات بسبب أخطاء البيانات أو الكود أثناء تنفيذ البرنامج…

كتلة المحاولة try هي كتلة
التعليمات البرمجية التي تحدث فيها استثناءات

كتلة catch
يمسك ويعالج محاولة استثناءات الكتلة


using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace C_Sharp
{
public
static class Program
{
static void Main(string[] args)
{
int id;
string name;
bool ch;

CODE:
try
{
Console.WriteLine("Enter number id");
id = int.Parse(Console.ReadLine());
ch = true;
}
catch (Exception)
{
Console.WriteLine("Wrong data entered\ntry again");
ch = false;
}
if (ch == false)
goto CODE;

try
{
trry:
Console.WriteLine("Enter your name");
name = Console.ReadLine();
ch = name.All(char.IsLetter);

// دالة حرفية تفحص اذا كان الادخال حروف فقط
if (ch == false)
{
Console.WriteLine("try again enter name");
goto trry;
}
}
catch (Exception)
{
Console.WriteLine("...");
}

Console.WriteLine("hello...&...");

Console.ReadLine();
}
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥


Enter number id
ee
Wrong data entered
try again
Enter number id
369

Enter your name
Code
hello...&...
👍1



tgoop.com/beginprogrammer/461
Create:
Last Update:

إ₰...👨🏻‍💻CODE👩🏻‍💻...₰❥

شرح استخدام try & catch

#try_and_catch
هي كلمات رئيسية تمثل معالجة الاستثناءات بسبب أخطاء البيانات أو الكود أثناء تنفيذ البرنامج…

كتلة المحاولة try هي كتلة
التعليمات البرمجية التي تحدث فيها استثناءات

كتلة catch
يمسك ويعالج محاولة استثناءات الكتلة


using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

namespace C_Sharp
{
public
static class Program
{
static void Main(string[] args)
{
int id;
string name;
bool ch;

CODE:
try
{
Console.WriteLine("Enter number id");
id = int.Parse(Console.ReadLine());
ch = true;
}
catch (Exception)
{
Console.WriteLine("Wrong data entered\ntry again");
ch = false;
}
if (ch == false)
goto CODE;

try
{
trry:
Console.WriteLine("Enter your name");
name = Console.ReadLine();
ch = name.All(char.IsLetter);

// دالة حرفية تفحص اذا كان الادخال حروف فقط
if (ch == false)
{
Console.WriteLine("try again enter name");
goto trry;
}
}
catch (Exception)
{
Console.WriteLine("...");
}

Console.WriteLine("hello...&...");

Console.ReadLine();
}
}
}

•┈┈┈•❈••✦✾✦••❈•┈┈┈•
•┈┈┈•❈••✦✾✦••❈•┈┈┈•


إ₰...Output....₰❥


Enter number id
ee
Wrong data entered
try again
Enter number id
369

Enter your name
Code
hello...&...

BY بدايه مبرمج


Share with your friend now:
tgoop.com/beginprogrammer/461

View MORE
Open in Telegram


Telegram News

Date: |

In the next window, choose the type of your channel. If you want your channel to be public, you need to develop a link for it. In the screenshot below, it’s ”/catmarketing.” If your selected link is unavailable, you’ll need to suggest another option. The group’s featured image is of a Pepe frog yelling, often referred to as the “REEEEEEE” meme. Pepe the Frog was created back in 2005 by Matt Furie and has since become an internet symbol for meme culture and “degen” culture. How to build a private or public channel on Telegram? In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. Find your optimal posting schedule and stick to it. The peak posting times include 8 am, 6 pm, and 8 pm on social media. Try to publish serious stuff in the morning and leave less demanding content later in the day.
from us


Telegram بدايه مبرمج
FROM American