Programmversion anzeige verbessert

This commit is contained in:
HuskyTeufel
2020-01-23 13:58:30 +01:00
parent 0030808d65
commit f988c6b5fa
2 changed files with 14 additions and 17 deletions

View File

@@ -85,6 +85,10 @@ namespace BerichtGen
if (rb_yes.Checked && cb_pdf.Checked && !hidden) if (rb_yes.Checked && cb_pdf.Checked && !hidden)
{ {
string pfad = Path.Combine(speicherpfad, string.Format("{0}.pdf", filename)); string pfad = Path.Combine(speicherpfad, string.Format("{0}.pdf", filename));
Process process = new Process();
process.StartInfo.FileName = "explorer";
process.StartInfo.Arguments = pfad;
//** Verbuggt
FrmPDFViewer frmPDFViewer = new FrmPDFViewer(pfad); FrmPDFViewer frmPDFViewer = new FrmPDFViewer(pfad);
frmPDFViewer.ShowDialog(); frmPDFViewer.ShowDialog();
} }

View File

@@ -27,7 +27,16 @@ namespace SanSystem
{ {
get get
{ {
return programmversion; string version = string.Empty;
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SanSystem." + "version.txt"))
{
using (StreamReader reader = new StreamReader(stream))
{
version = reader.ReadToEnd();
}
}
return version;
} }
} }
@@ -113,23 +122,7 @@ namespace SanSystem
public Global() public Global()
{ {
LadeRegistry(); LadeRegistry();
programmversion = ReadProgrammVersion();
}
private string ReadProgrammVersion()
{
// Nachfolgend zeigt alle resources an
//string[] resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
string version = string.Empty;
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SanSystem." + "version.txt"))
{
using (StreamReader reader = new StreamReader(stream))
{
version = reader.ReadToEnd();
}
}
return version;
} }
~Global() ~Global()