Bonjour
j'ai cette fonction :
Seulement il ne compile pas puisque qu'il me dit qu'il ne connais pas "type". Comment puis-je résoudre ce problème ?
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; }
Ma fonction est-elle invalide ?
Partager