Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

FileAttachment.Load() get's stuck

$
0
0

Hi

I'm developing a console application in C# to download email attachments, so i fetch the emails and download the attachment and it works fine, but when I change the project properties from console application to windows application the FileAttachement.Load() function get's stuck 

EmailMessage email = EmailMessage.Bind(service,it.Id, new PropertySet(ItemSchema.Attachments));
Attachment att = email.Attachments[0];
FileAttachment fileAtt = att as FileAttachment;
FileStream file = new FileStream("FilePath",FileMode.OpenOrCreate, FileAccess.ReadWrite);
fileAtt.Load(file);
file.Close();
file.Dispose();

Regards, 

Daniel V



Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>