Bonjour,
j'essaye de faire tourner le code suivant sous IIS en Framework 2.0
J'ai systématiquement le message d'erreur suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 <%@ Import Namespace="System" %> <script language="C#" runat="server" > class Program { static void Main() { string[] array = { "cat", "dot", "perls" }; // Use Array.Exists in different ways. bool a = Array.Exists<string>(array, "perls"); bool b = Array.Exists<string>(array, "python"); // Display bools. Response.Write(a); Response.Write(b); } } </script>
Je ne comprends pas ce qui cloche
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Message d'erreur du compilateur: CS1502: La méthode surchargée correspondant le mieux à 'System.Array.Exists<string>(string[], System.Predicate<string>)' possède des arguments non valides Erreur source: Ligne 10 : Ligne 11 : // Use Array.Exists in different ways. Ligne 12 : bool a = Array.Exists<string>(array, "perls"); Ligne 13 : bool b = Array.Exists<string>(array, "python"); Ligne 14 : Fichier source: c:\inetpub\wwwroot\array_exists.aspx Ligne: 12
merci de votre aide
Partager