Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
fix problem with readonly directories, when trying to profile executa…
Browse files Browse the repository at this point in the history
…ble in %PROGRAMFILES%
  • Loading branch information
siegfriedpammer committed Nov 21, 2011
1 parent 51c3a09 commit e1a6f2b
Showing 1 changed file with 11 additions and 4 deletions.
Expand Up @@ -39,10 +39,17 @@ void btnStartClick(object sender, RoutedEventArgs e)
if (!Directory.Exists(txtWorkingDir.Text))
throw new DirectoryNotFoundException("directory '" + txtWorkingDir.Text + "' was not found!");

string outputPath = Path.Combine(
Path.GetDirectoryName(txtExePath.Text),
@"ProfilingSessions\Session" +
DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture) + ".sdps");
string outputName = "Session" + DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture) + ".sdps";
string outputPath = "";

SaveFileDialog sfd = new SaveFileDialog();
sfd.InitialDirectory = Path.GetDirectoryName(txtExePath.Text);
sfd.Filter = StringParser.Parse("${res:AddIns.Profiler.FileExtensionDescription}|*.sdps");
sfd.FileName = outputName;
if (sfd.ShowDialog() == true)
outputPath = sfd.FileName;
else
return;

try {
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
Expand Down

0 comments on commit e1a6f2b

Please sign in to comment.