bonjour,
je voudrais récupérer le type d'un string et faire une comparaison,
mais j'ai une erreur
voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
//String Mystring = "1234";
 string Mystring = "blabla";
 
Type type = MyString.GetType();
            if (type == System.String)
            {
//instructions
            }
 
            if (type == System.Int32)
            {
//instructions
            }
voici l'erreur:

String is a type which is not valid in the current context
//int is a type which is not valid in the current context
quelqu'un aurait t-il une idée
merci