Error while reading the contents of txt file using Silverlight 3.0

Jun 29, 2009 at 2:35 PM

Hello

I am using Silverlight 3.0 and WCF service to read the contents of .txt file and then send it to the server. I am getting the error namely "Attempt to access the method failed: System.IO.StreamReader..ctor(System.String)" while executing the following code:

Dictionary<String, string> objAttachDocArgs = new Dictionary<String, string>();

StreamReader myReader = new StreamReader(FileDialog.File.Name);

objAttachDocArgs.Add(AttachCounter++ + "_" + FileDialog.File.Name, myReader.ReadLine());
myReader.Close();  

Here 'objAttachDocArgs' is a Dictionary type of object through which I want to send the contents of a txt file to the server.

 

Please let me know where iam missing.

Thanks in advance

Coordinator
Jun 30, 2009 at 10:26 AM

I think you would be better placing this question on the Silverlight discussion forum.

http://silverlight.net/forums/

Thanks,

-Stuart.