M
MikeY
Hi everyone,
I"m having a problem with the OpenFileDialog() changing my path to save to
my .resources file. I'm a bit baffled why this is happening, even when I
set the OpenFileDialog back to the inital directory where the .resource file
resides.
What I am trying to do is get the location of my database and save it to
string format in my resource file (un-embedded). When I go to save this
information to my .resouce file it creates another resource file at the
location that I selected the database from and not the origional one. Now
this problem does not a rise when I manually type in to my textbox the
location of my database.
A sample of my OpenFileDialog() is as follows, then my Save to .resource
file:
//SET-UP DATABASE LOCATION
private void DB_Connection_Click(object sender, System.EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory = Application.StartupPath;
dlg.Filter = ".MDB Files (*.mdb)|*.mdb";
dlg.ReadOnlyChecked = true;
dlg.ShowReadOnly = true;
if(dlg.ShowDialog() == DialogResult.OK)
{
this.txtBox_DB_Connection.Text = dlg.FileName;
}
//RESET
dlg.RestoreDirectory = true;
dlg.Dispose();
}
****************************************
//RETURN FROM TECH ZONE FOR UPDATES
private void Tech_Return(string Host_BackEnd,string Connection,string
Machine_Name,string Station_Printer,string Adverts,string Bar_Printer)
{
ResourceWriter Writer = new ResourceWriter("HOST.resources");
//
Writer.AddResource("HOST_BACKEND", Host_BackEnd);
Writer.AddResource("DB CONNECTION", Connection);
Writer.AddResource("MACHINE NAME", Machine_Name);
Writer.AddResource("STATION PRINTER", Station_Printer);
Writer.AddResource("COMMERCIAL", Adverts);
//JUST MORE OF THE SAME HERE
//
Writer.Generate();
Writer.Close();
Writer.Dispose();
}
I'm not sure what I"m missing or is going wrong here, so any and all help is
appreciated.
Thank you all in advance.
I"m having a problem with the OpenFileDialog() changing my path to save to
my .resources file. I'm a bit baffled why this is happening, even when I
set the OpenFileDialog back to the inital directory where the .resource file
resides.
What I am trying to do is get the location of my database and save it to
string format in my resource file (un-embedded). When I go to save this
information to my .resouce file it creates another resource file at the
location that I selected the database from and not the origional one. Now
this problem does not a rise when I manually type in to my textbox the
location of my database.
A sample of my OpenFileDialog() is as follows, then my Save to .resource
file:
//SET-UP DATABASE LOCATION
private void DB_Connection_Click(object sender, System.EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory = Application.StartupPath;
dlg.Filter = ".MDB Files (*.mdb)|*.mdb";
dlg.ReadOnlyChecked = true;
dlg.ShowReadOnly = true;
if(dlg.ShowDialog() == DialogResult.OK)
{
this.txtBox_DB_Connection.Text = dlg.FileName;
}
//RESET
dlg.RestoreDirectory = true;
dlg.Dispose();
}
****************************************
//RETURN FROM TECH ZONE FOR UPDATES
private void Tech_Return(string Host_BackEnd,string Connection,string
Machine_Name,string Station_Printer,string Adverts,string Bar_Printer)
{
ResourceWriter Writer = new ResourceWriter("HOST.resources");
//
Writer.AddResource("HOST_BACKEND", Host_BackEnd);
Writer.AddResource("DB CONNECTION", Connection);
Writer.AddResource("MACHINE NAME", Machine_Name);
Writer.AddResource("STATION PRINTER", Station_Printer);
Writer.AddResource("COMMERCIAL", Adverts);
//JUST MORE OF THE SAME HERE
//
Writer.Generate();
Writer.Close();
Writer.Dispose();
}
I'm not sure what I"m missing or is going wrong here, so any and all help is
appreciated.
Thank you all in advance.