Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

create some file such as image or excel or word document

$
0
0
Hi
I have  a Silverlight application ,I attache some file such as image or excel or word document as a array in database , and then show them with these codes in client system, it works when I run it on visual studio but when I publish my project and run it on iis or on a web, It dose not show attached file can any body help me?
thanks
  try
            {
                System.IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\CImage");

            }
            catch (Exception ex)
            {
            }

                try
                {
                    System.IO.File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\CImage\\" + (e.Result.Last().NameFile .ToString().Trim()) + "-" + (e.Result.Last().Id.ToString().Trim()) + "." + (e.Result.Last().Format.ToString().Trim()), e.Result.Last().FileAttach );

                }
                catch (Exception ex)
                {
                }

            try
            {
                dynamic shell = AutomationFactory.CreateObject("Shell.Application");
                shell.ShellExecute(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\CImage\\" + (e.Result.Last().NameFile.ToString().Trim()) + "-" + (e.Result.Last().Id.ToString().Trim()) + "." + (e.Result.Last().Format.ToString().Trim()));

            }
            catch (Exception ex)
            {
                return;
            }


Viewing all articles
Browse latest Browse all 1083

Trending Articles



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