user3519507
user3519507

Reputation: 15

try catch in VB to C#

I want to convert this line from VB to C#:

Catch ex As Exception
        DevComponents.DotNetBar.MessageBoxEx.Show("Đường dẫn không chính xác", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information)

I used total this line in C#, but I got error at the name "Devcomponent" Who helps me..

Upvotes: 0

Views: 218

Answers (2)

David
David

Reputation: 5003

catch(Exception ex)
{
  DevComponents.DotNetBar.MessageBoxEx.Show("Đường dẫn không chính xác", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information)
}

NOTE:

but I got error at the name "Devcomponent"

I'm assuming you have imported the .dll for DevComponents and have it in a using statement in your file already, yes? Also, I don't know anything about that specific method, so I can't advise there...

Upvotes: 0

aw04
aw04

Reputation: 11187

try
{
    //do whatever
}
catch (Exception ex)
{
    //do whatever
}

If you don't need DevComponents you can use MessageBox.Show() instead

Upvotes: 1

Related Questions