Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic save button (Read 1597 times)
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
save button
Oct 9th, 2009 at 2:35am
Print Post  
HI,

I am using Flowchrter website from samplrles..i am using same code in my server,,for save and load button i am using same code in flow charter
Code
Select All
 listFileNames.Items.Clear();

  string localDir = MapPath(@"Files\");

  DirectoryInfo dir = new DirectoryInfo(localDir);

  foreach (FileInfo fileInfo in dir.GetFiles())










listFileNames.Items.Add(fileInfo.Name);
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {

  if (!String.IsNullOrEmpty(tbFileName.Text))

  {


string localDir = MapPath(@"Files\");


diagramView.Diagram.SaveToFile(localDir + tbFileName.Text);

  }
    }

    protected void btnLoad_Click(object sender, EventArgs e)
    {

  if (!String.IsNullOrEmpty(listFileNames.SelectedValue))

  {


string localDir = MapPath(@"Files\");


diagramView.Diagram.LoadFromFile(localDir + listFileNames.SelectedValue);

  }
    } 




but i am getting following error

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\inetpub\wwwroot\ERP_SYS\scm\Diagrams\Files\Diagram( 10\08\2009 ).fc'.

Source Error:
;
Line 73:

diagramView.Diagram.SaveToFile(localDir + tbFileName.Text);



i need to save those files in

ERP_SYS\scm\Diagrams\Files

how can i save and load files ...










  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: save button
Reply #1 - Oct 9th, 2009 at 5:46am
Print Post  
I don't think you can have backslash symbols in file names. The system might be looking for a "Diagram( 10" folder in this case. You should replace the backslash symbols from the date string with another character when generating file names.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint