What about [Assembly]?

A

ad

I have study a vb codes:

Dim Asm As [Assembly] = [Assembly].GetExecutingAssembly()

How can I do in C#
 
A

Adam Clauss

ad said:
I have study a vb codes:

Dim Asm As [Assembly] = [Assembly].GetExecutingAssembly()

How can I do in C#

Assembly Asm = Assembly.GetExecutingAssembly();
 
P

Peter Rilling

You may have to reference to the System.Reflection though.

Adam Clauss said:
ad said:
I have study a vb codes:

Dim Asm As [Assembly] = [Assembly].GetExecutingAssembly()

How can I do in C#

Assembly Asm = Assembly.GetExecutingAssembly();
 
D

Daniel O'Connell [C# MVP]

ad said:
I have study a vb codes:

Dim Asm As [Assembly] = [Assembly].GetExecutingAssembly()

How can I do in C#

Just to explain the reasoning behind the other posters perfectly correct
answer, the square brackets([ ]) in VB are there to mark the keyword
'Assembly' as not a keyword, to achieve the same thing(although you don't
need it with the word 'Assembly') you would prefix the identifier with @.
 
A

Adam Clauss

True, but that is also true for the VB.Net code (isn't it? Guess I don't
actually know that, I just assumed it was).

--
Adam Clauss

Peter Rilling said:
You may have to reference to the System.Reflection though.

Adam Clauss said:
ad said:
I have study a vb codes:

Dim Asm As [Assembly] = [Assembly].GetExecutingAssembly()

How can I do in C#

Assembly Asm = Assembly.GetExecutingAssembly();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top