using System;
using System.IO;
using System.Xml.Serialization;
namespace xmlserialize3
{
public class A
{
static void Main(string[] args)
{
XmlSerializer pp = new XmlSerializer(typeof(A));
Console.WriteLine("enter no.of elements of array");
int i = int.Parse(Console.ReadLine());
string[] ar1 = new string[i];
for (int a = 0;a<ar1.Length; a++)
{
ar1[a] = Console.ReadLine();
}
FileStream fs = new FileStream("F:\\net\\3rdfile.xml", FileMode.Create);
pp.Serialize(fs, ar1);
Console.WriteLine("fileserialized");
Console.ReadKey();
}
}
}
i use this code but it shows exception