Guest User

Untitled

a guest
Jan 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.28 KB | None | 0 0
  1.     Private Sub SaveSourceCode(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveCode.Click
  2.         ShowBusy("Saving the source code...")
  3.  
  4.         If My.Settings.DefaultOutputFolder Is String.Empty Then
  5.             My.Settings.DefaultOutputFolder = Application.StartupPath & "\output\"
  6.             My.Settings.Save()
  7.         End If
  8.         With Me.SaveCodeDialog
  9.             .InitialDirectory = My.Settings.DefaultOutputFolder
  10.             .FileName = Me.cmbLanguage.Text
  11.             If .ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
  12.                 Try
  13.                     File.WriteAllText(.FileName, ResultCode)
  14.                     Try
  15.                         Process.Start(.FileName)
  16.                     Catch ex As Exception
  17.                     End Try
  18.                     MessageBox.Show("The code is saved succecfully", "AfterCopy3.0", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
  19.                 Catch ex As Exception
  20.                     MessageBox.Show("the code source could not be saved in this location", "AfterCopy3.0", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
  21.                 End Try
  22.             End If
  23.         End With
  24.         ShowToolBar(ExportToolBar)
  25.     End Sub
Add Comment
Please, Sign In to add comment