No overload Error

C

CrazyDrummer

Hi all, I am a newbie of C#, when i am trying the code in the following
topic

http://msdn2.microsoft.com/en-us/library/aa302405.aspx#Mtps_DropDownFilterText

"C:\Visual Studio Projects\Encryption\Encryptor.cs(30): No overload for
method 'GetCryptoServiceProvider' takes '1' arguments" & "C:\Visual Studio
Projects\Encryption\Decryptor.cs(30): No overload for method
'GetCryptoServiceProvider' takes '1' arguments" will show during
compilation.

Can anyone explain what the problems and how to solve?
 
J

Jon Skeet [C# MVP]

Hi all, I am a newbie of C#, when i am trying the code in the following
topic

http://msdn2.microsoft.com/en-us/library/aa302405.aspx#Mtps_DropDownF...

"C:\Visual Studio Projects\Encryption\Encryptor.cs(30): No overload for
method 'GetCryptoServiceProvider' takes '1' arguments" & "C:\Visual Studio
Projects\Encryption\Decryptor.cs(30): No overload for method
'GetCryptoServiceProvider' takes '1' arguments" will show during
compilation.

Can anyone explain what the problems and how to solve?

The problem is that there's only a method with two parameters, and
you're trying to call it with a single argument.

In other words, the code sample is broken as far as I can see.

Jon
 
M

Mr. Arnold

"C:\Visual Studio Projects\Encryption\Encryptor.cs(30): No overload for
method 'GetCryptoServiceProvider' takes '1' arguments" & "C:\Visual Studio
Projects\Encryption\Decryptor.cs(30): No overload for method
'GetCryptoServiceProvider' takes '1' arguments" will show during
compilation.

Can anyone explain what the problems and how to solve?

You're making a call to a method that takes a parameter or parameters, and
either you're giving it to few, too many or no parameters when you're making
the call to the method.

When you highlight a method in the IDE, you should be able to see a down
arrow on the method that you can walk through it to see the different
signatures a method can use with parameters being passed to it.
 
C

CrazyDrummer

Thanks All

Mr. Arnold said:
You're making a call to a method that takes a parameter or parameters, and
either you're giving it to few, too many or no parameters when you're
making the call to the method.

When you highlight a method in the IDE, you should be able to see a down
arrow on the method that you can walk through it to see the different
signatures a method can use with parameters being passed to it.
 

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