[Message Deleted]
-
vahidha wrote:
I need java code for that purpose
And you are asking for that in a C# forum???:confused:
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
A few points.
vahidha wrote:
Its very urgent..
Not for me it isn't. I couldn't care less.
vahidha wrote:
I need java code for that purpose
If you can't tell the difference between C# and Java, you're not even qualified to stuff envelopes for a living.
vahidha wrote:
I need java code
This isn't rentacoder - we don't write your code for you here. We expect you to get off your lazy ass and write it yourself. We'll help if you get stuck, but as we don't get your pay check, we don't do your job.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
this your code
try
{
if (!question.ToUpper().Contains("C#")){
throw new WrongForumException("You are in wrong forum.");
}
if (question.ToUpper().Contains("URGENT")){
throw new NotYourSlaveException("We are not your slave dud.");
}
SomeBodyWillTryToAnswerYourQuestion();
}
catch (Exception ex)
{
Console.WriteLine("Nice try, but "+ ex.Message +" raised");
}hope it will open your mind.
dhaim ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro" in the front line gave a lead, in the middle line build goodwill, in the behind give power support
-
this your code
try
{
if (!question.ToUpper().Contains("C#")){
throw new WrongForumException("You are in wrong forum.");
}
if (question.ToUpper().Contains("URGENT")){
throw new NotYourSlaveException("We are not your slave dud.");
}
SomeBodyWillTryToAnswerYourQuestion();
}
catch (Exception ex)
{
Console.WriteLine("Nice try, but "+ ex.Message +" raised");
}hope it will open your mind.
dhaim ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro" in the front line gave a lead, in the middle line build goodwill, in the behind give power support
Not to be pedantic but you really shouldn't swallow exceptions. If you are going to swallow the exceptions then you probably don't need to throw them. An if statement is way more appropriate.
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane