Bonjour
j'ai cette fonction :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
public object DeSerializeObject(Stream stream, Type type)
        {
            stream.Position = 0;
            object objectToSerialize;
            BinaryFormatter bFormatter = new BinaryFormatter();
            objectToSerialize = (type)(bFormatter.Deserialize(stream));
            stream.Close();
            return objectToSerialize;
        }
Seulement il ne compile pas puisque qu'il me dit qu'il ne connais pas "type". Comment puis-je résoudre ce problème ?
Ma fonction est-elle invalide ?