Quantcast
Channel: Lync 2010 and OCS - Lync Clients and Devices forum
Viewing all articles
Browse latest Browse all 3260

How to read/write local file in lync silverlight application?

$
0
0

I tried doing that by various method but an exception pop-ups. My lync silverlight application works fine in browser or out of browser (with elevated permissions) but when I try to do so in lync's window extension (CWE) is throws an exception saying "File operation not permitted. Access to path '<some path>' is denied". Please help!

private void button1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(textBox1.Text))
                {
                    string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "abc.txt");
                    StreamWriter writer = File.CreateText(path);
                    writer.Write(textBox1.Text);
                    writer.Close();
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Data + "\n\n" + ee.Message);
            }
        }


Viewing all articles
Browse latest Browse all 3260

Trending Articles



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