TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
martycom
NA
1
0
c# compile errors
Dec 23 2004 11:04 PM
serialize3.cs(28,16): error CS1501: No overload for method 'File' takes '1' arguments serialize3.cs(29,18): error CS1501: No overload for method 'Open' takes '1' arguments I copied code from the article "Serializing objects in c# by Bepin Joshi", ran a compile and got the error messages above. I don't have enough knowledge to correct them. I think it has something to do with the code being older (1991).I have copied the code below. Any suggestions would be appreciated. using System; using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; public class SerialTest { public void SerializeNow() { ClassToSerialize c=new ClassToSerialize(); File f=new File("temp.dat"); Stream s=f.Open(FileMode.Create); BinaryFormatter b=new BinaryFormatter(); b.Serialize(s,c); s.Close(); } public void DeSerializeNow() { ClassToSerialize c=new ClassToSerialize(); File f=new File("temp.dat"); Stream s=f.Open(FileMode.Open); BinaryFormatter b=new BinaryFormatter(); c=(ClassToSerialize)b.Deserialize(s); Console.WriteLine(c.name); s.Close(); } public static void Main(string[] s) { SerialTest st=new SerialTest(); st.SerializeNow(); st.DeSerializeNow(); } } public class ClassToSerialize { public int age=100; public string name="bipin"; }
Reply
Answers (
1
)
Using separate class to handle events of user controls
Reflection