15,885,546 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11866893 (Top 12 by date)
Member 11866893
16-Feb-21 15:09pm
View
I want to make 1 Yvalue navy and the other Yvalue red for each student (Xvalue).
Member 11866893
16-Feb-21 14:58pm
View
This does not answer my question. This shows how to change the color for each student. I want the bar color Navy for wins and Red for losses for all students. Right now the bars are showing up light blue for wins and yellow for losses for each student.
Member 11866893
15-Mar-20 17:20pm
View
I have 50 students and want to display their wins and losses. So 50 X axis entries and 50 y axis data entries on a bar chart looks horrible and it was the same on all of them I tried. That many students makes the chart difficult to read or unreadable on some. Also, my students are likely to grow to 100 or more in the next year or two so whatever I do has to be able to display 100 students. I may split the students up into smaller categories and do charts for each category. That is at least the next thing I am going to try. I really like the charts in excel they look so much better so the alternate plan is to try to export the table from access into excel and build the graph then display the spreadsheet on my form. Although, excel has the same issue I run into with the chart control except it isn't quite as bad.
Member 11866893
16-Dec-16 8:20am
View
Ok I came up with a work around that meets my needs for user directories. I will still need to figure how to remove one orphaned SID from an ACL so I can use it on group directories but for now this works well. The code is posted below. Thanks for helping what you wrote helped me troubleshoot and come up with the part of the solution below.
Member 11866893
14-Dec-16 15:59pm
View
no joy. that just displayed the subdirectories with orphaned SIDs too. I have a tool that purges all the entries on an ACL, I may try to use that and just purge everything and put back just the domain admin groups. I don't see just removing the orphaned SID ever working. nothing I have tried yet has come close to working. if the other code works I will post an update and close the question out.
Member 11866893
14-Dec-16 15:00pm
View
You may have been onto something with inheritance. I looked up GetAccessRules this is Microsoft's explanation said:
Public Function GetAccessRules (includeExplicit As Boolean, includeInherited As Boolean, targetType As Type)
So I changed this line of the code: Dim rules = security.GetAccessRules(True, False, GetType(SecurityIdentifier))
to: Dim rules = security.GetAccessRules(True, True, GetType(SecurityIdentifier))
So far I can see that is wasn't displaying the results correctly. It was only finding the orphaned SID on each top directory. It is still running but now it is displaying all subdirectories under each top directory. So hopefully the reason it was not removing it was because inheritance was set on each user folder and the flag that was set to false was causing it to not perform the way I wanted it too. When it finishes I will let you know if that was the issue.
Member 11866893
14-Dec-16 14:41pm
View
I looked at the advanced properties of one the user folders not being processed properly and it definitely shows the orphaned SID not inheriting.
Member 11866893
14-Dec-16 14:15pm
View
I will run it again on one user folder and then manually check it to see if the inheritance is the issue. I don't think it is because I select the parent folder which is f:\user1 with FolderBrowserDialog and each user has a folder under user1. It is correctly finding and displaying the user folders. I have all subfolders and files inheriting under the user folder inheriting permissions from the user folder that is displayed correctly not from user1. I will let you know. I have only been programming so it is possible I might overlook something like that.
Member 11866893
14-Dec-16 13:56pm
View
I tried the code you posted with both dsecurity and diracls. I also tried with the dinfo.setaccesscontrol(desecurity) the way you posted it and also inside the loop. It is still just finding the orphaned sid and properly displaying it in the listbox as well as logging it but not removing it.
If removeList.Count <> 0 Then
'Dim DirACLs As New Security.AccessControl.DirectorySecurity(Path, AccessControlSections.All)
Using logWriter As New StreamWriter("c:\orphansid.txt", True)
For Each id In removeList
ListBox1.Items.Add("Removed the following SID: " & id.ToString & " From " & Path & vbCrLf)
logWriter.WriteLine("Removed the following SID: {0} From {1}", id, Path)
dSecurity.PurgeAccessRules(id)
dinfo.SetAccessControl(dSecurity)
Next
End Using
End If
I am a domain admin and I am running the program with elevated privileges. Any ideas what else I may be doing wrong?
Member 11866893
13-Oct-15 13:09pm
View
Where in my question did I say not working? I said isn't. I am asking if it will work or should work and if not what is wrong with it and how do I fix it? I tried it and when I click the button I get no errors and it doesn't map the drive.
Member 11866893
13-Oct-15 12:32pm
View
Deleted
The suggestions I received were not useful at all. I would rather not received a response. No example code or even an explanation to go along with the suggestions. Thanks for nothing.
Member 11866893
9-Oct-15 13:52pm
View
This is one that I don't understand where to put the uncpath and drive letter.
Public Declare Function WNetAddConnection2 _
Lib "mpr.dll" Alias "WNetAddConnection2A" _
(
ByRef lpNetResource As NETRESOURCE,
ByVal lpPassword As String,
ByVal lpUserName As String,
ByVal dwFlags As Integer) As Integer
Public Declare Function WNetCancelConnection2 _
Lib "mpr" Alias "WNetCancelConnection2A" _
(
ByVal lpName As String,
ByVal dwFlags As Integer,
ByVal fForce As Integer) As Integer
<structlayout(layoutkind.sequential)>
Public Structure NETRESOURCE
Public dwScope As Integer
Public dwType As Integer
Public dwDisplayType As Integer
Public dwUsage As Integer
Public lpLocalName As String
Public lpRemoteName As String
Public lpComment As String
Public lpProvider As String
End Structure
' Public Const ForceDisconnect As Integer = 1
Public Const RESOURCETYPE_DISK As Long = &H1
'''
''' Maps a UNC path to a specific drive.
'''
''' <param name="DriveLetter"></param>
''' <param name="UNCPath"></param>
''' <returns>
''' <remarks>
Public Function MapDrive(ByVal DriveLetter As String, ByVal UNCPath As String) As Boolean
Dim nr As NETRESOURCE
Dim Username As String
Dim Password As String
nr = New NETRESOURCE
nr.lpRemoteName = UNCPath
nr.lpLocalName = DriveLetter & ":"
Username = Nothing '(add parameters to pass this if necessary)
Password = Nothing '(add parameters to pass this if necessary)
nr.dwType = RESOURCETYPE_DISK
Dim result As Integer
result = WNetAddConnection2(nr, Password, Username, 0)
If result = 0 Then
Return True
Else
Return False
End If
End Function
Here are the others
Private Sub Command_Click()
Dim startInfo As ProcessStartInfo
startInfo = New System.Diagnostics.ProcessStartInfo("cmd.exe", """NET USE F: \\xxxxxxxxx\CSC Backup""")
End Sub
Dim procID As Integer
Dim newProc As Diagnostics.Process
newProc = Diagnostics.Process.Start("C:\WINDOWS\SYSTEM32\NET.EXE")
procID = newProc.SessionId
procID = Shell("""net use F: \\xxxxxxx\csc backup")
Show More