|
Exception Sample :
static void Main(string[] args) {
try{
Console.WriteLine("Level 1");
try {
Console.WriteLine("Level 2");
goto exit;
}
finally {
Console.WriteLine("Level 2 Finished");
}
}
finally {
Console.WriteLine("Level 1 Finished");
}
exit: ;
}
What is the wrong in this code sample above?
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Are you asking @ sytanx or what.. It will compile successfully.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
hi kulakarni,
thanks for the response.
actually today i took one pre assessment test in C#. they asked this question.
they gave me 5 options:
What is the console output for the code sample above?
Choice 1
Level 1
Level 2
Level 2 Finished
Level 1 Finished
Choice 2
Level 1
Level 2
Level 1 Finished
Choice 3
Level 1
Level 2
Choice 4
Level 1
Level 2
Level 1 Finished
Level 2 Finished
Choice 5
Level 1
Level 2
Level 2 Finished
which one is the correct out put?
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
It is obvious choice1. Because of the rule that finally block is always executed inspite of any excpetion is occured or not. In this case, inner most try and finally is executed first and then the outer one.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
oho....thanks Kulakarni.
i know this but when i saw the question, i didn't understand the question first of all........now i came to know the correct answer!
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
The problem is that you are using GOTOs Get over that crutch quickly.
|
|
|
|
|
Hi everyone,
How to get Insert button status?
Thank You.
|
|
|
|
|
Is the following feasible?
I'm looking for a way to develop an application that is developed in dot NET that looks like a desktop application and can be run within a browser the same way a Java applet or an ActiveX application does.
Please advise.
|
|
|
|
|
My msn:
wangpc@msn.com
Welcome everyone!
|
|
|
|
|
I am sorry but I do not think people are here for making friends. Anyways if you have any .NET related questions, you will get answers.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
THe best place to post this is in the soap-box there you will make more firends.
Go on, move the thread to the soap-box and see how welcoming people there will be,
|
|
|
|
|
The lounge is a good place to meet people. This forum is better for asking programming questions.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I have one question... How do you get an image to show up on a windows form? I've got that you can use the this.BackgroundImage property of the window, but I want to be able to put it anywhere, like a ControlItem.
---
*** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
Description: A 13 Year Old Programming Wiz
The elementary kids were right! "1" + "1' does = "11"!
|
|
|
|
|
OK I did a little more research and found the PictureBox class. I think this will be all that I need... If there are any more suggestions please let me know.
-----
*** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
Description: A 13 Year Old Programming Wiz
The elementary kids were right! "1" + "1" does = "11"!
|
|
|
|
|
I never use a picture box, I just draw direct on the screen. But, a picture box will work fine.
max29297 wrote: A 13 Year Old Programming Wiz
If I were you, I'd remove that until you've moved along the learning curve a bit. It just doesn't work, yet. I'm sure one day it will
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
well, it's really there because I've really mastered javascript. I've only recently started learning c#
-----
*** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
Description: A 13 Year Old Programming Wiz
The elementary kids were right! "1" + "1" does = "11"!
|
|
|
|
|
I am having a problem printing to a Brother HL-2700CN printer from a C# graphics object.
Every other printer works fine and prints both graphics & text correctly. The Brother printer prints graphics correctly, but the text is just a whole lot of jibberish.
I am using common fonts:
Font headerFont = new Font("Times New Roman", 26, FontStyle.Bold, GraphicsUnit.Pixel);
Font headerInfoFont = new Font("Arial", 16, FontStyle.Bold, GraphicsUnit.Pixel);
Has this got anything to do with the printer driver?
Hope you can help,
Cheers!
|
|
|
|
|
Hi ,
I am wondering if there is anyone who can help me to load just a portion of TIFF image to memory, then I can display that portion to a form .
Thanks
|
|
|
|
|
GDI+ will only load the entire image, and I'm not sure how TIFF is compressed ( could complicate reading only part of it ). Either way, you need a third party library, I believe.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You must understand the TIFF specs and build your own code or use a third party lib as mentioned. Same is for every image file. BMB is just the simplest
|
|
|
|
|
Hi, I populate a listview's items as follows:
listView1.Items.Clear();<br />
this.emailTableAdapter.Fill(this.myclubDataSet.Email);<br />
<br />
foreach (DataRow dataRow in myclubDataSet.Email.Rows)<br />
{<br />
string fullName = dataRow["FullName"].ToString();<br />
string firstName = dataRow["FirstName"].ToString();<br />
string lastName = dataRow["LastName"].ToString();<br />
string address = dataRow["Address"].ToString();<br />
<br />
string[] myItems = new string[] <br />
{<br />
firstName,<br />
lastName,<br />
address<br />
};<br />
<br />
ListViewItem lvi = new ListViewItem(myItems);<br />
<br />
listView1.Items.Add(lvi);
When I run the program in debug mode from the VS2005 IDE the fields are filled out nicely BUT when I run the same program in the OS I get three dots hard up against the right end of the field:
eg |Glen ...|Harvy ...|glen@somewhere.com ...|
The dots aren't there in debug mode.
Cosmetic I know - but why?
Glen Harvy
|
|
|
|
|
It's likely the form is a different size, and it's showing you that it can't show all the data.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I thought of that and checked the string lengths but I'll check again.
Glen Harvy
|
|
|
|
|
How can i display picture on button tool ?
Well dragging picture box over button tool doesnt solve this as i want button click option aswell. Its just instead of writing text over button i want picture .
Thanks
|
|
|
|
|
PictureBox.Enabled=false;
Luc Pattyn
|
|
|
|