Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

open

$
0
0

Hello All,

I have coded the open file dialog as below:

protectedvoid btnGetFile_Click(object sender, EventArgs e)

        {

           this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();

           Thread newThread = newThread(newThreadStart(ThreadMethod));

            newThread.SetApartmentState(ApartmentState.STA);

            newThread.Start();

        }

protectedvoid ThreadMethod()

        {

      string SourcePath;

      string DestPath;

           SourcePath = @"C:/inetpub/wwwroot/ExcelFiles/Import/ImportMeter.xls";

 

           this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();

            openFileDialog1.ShowDialog();

            SourcePath = openFileDialog1.FileName;

            DestPath = @"C:/inetpub/wwwroot/ExcelFiles/Test.xls";

            System.IO.

     File.Delete(DestPath);

     File.Copy(SourcePath, DestPath);

          MessageBox.Show(openFileDialog1.FileName);

        }

This code works on Visual Studio, but when I set it on the IIS server, it does not work

Would you help me to resolve this issue, what do I need to do?

Thank you very much

Maan


Viewing all articles
Browse latest Browse all 1507

Trending Articles



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