Message 1 of 7

Not applicable
01-22-2021
09:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an code that use windows forms to browse for folder, but I want to change it to Inventor menu because it's so painful to look for folder now when I have about 10000 folders existing.
Private Sub btnSetOutputFolder_Click(sender As System.Object, e As System.EventArgs) Handles btnSetOutputFolder.Click
Try
Dim dlgFolder As New System.Windows.Forms.FolderBrowserDialog
dlgFolder.Description = "Select the folder to save output files"
If dlgFolder.ShowDialog() = DialogResult.OK Then
Dim outFolder As String = dlgFolder.SelectedPath
Dim odirectory As DirectoryInfo = New DirectoryInfo(outFolder)
Dim dSecurity As DirectorySecurity = odirectory.GetAccessControl()
If odirectory.Exists Then
Dim fileSec = System.IO.File.GetAccessControl(outFolder, Security.AccessControl.AccessControlSections.Access)
Dim accessRules = fileSec.GetAccessRules(True, True, GetType(System.Security.Principal.NTAccount))
For Each rule As System.Security.AccessControl.FileSystemAccessRule In accessRules
If (rule.AccessControlType.ToString = "Allow") Then
txtOutputFolder.Text = dlgFolder.SelectedPath
End If
Next
End If
End If
Dim Inv As New mInventor()
Catch ex As Exception
txtOutputFolder.Text = ""
MsgBox("Write Permission denied", MsgBoxStyle.Critical)
End Try
End Sub
Is there a way to convert this old school Folder Browser into Inventor Save As style?
Thanks!
Solved! Go to Solution.