|
Dave Kreskowiak wrote: the caret in a CMD prompt is used by the CMD prompt as an escape character But only when typing a command sequence into cmd. Using cin, scanf or similar it is passed direct to the calling application.
|
|
|
|
|
The command line is exactly where he's typing the password, for whatever reason.
|
|
|
|
|
Yes I discovered that after I posted my message to you. But using double quotes round the password fixes it. However, not the best way of doing such an application.
|
|
|
|
|
Agreed. I just told him you would normally never ask for a password on the command line but instead prompt for it after the app launches.
|
|
|
|
|
|
What is the exception that is being thrown? Is that why it is returning false, or is it genuinely the return value?
|
|
|
|
|
The one thing you have not shown us is the actual code that reads the password string.
|
|
|
|
|
Here's the code that Dave has given to me (I changed it a little bit):
Imports System.DirectoryServices.AccountManagement
Module Module1
Sub Main(ByVal args() As String)
Dim isWithAD As Boolean
Try
Dim pc As PrincipalContext = New PrincipalContext(ContextType.Domain, "xx.xx.xx.xx")
Using (pc)
isWithAD = pc.ValidateCredentials(args(0), args(1))
End Using
Console.WriteLine(IIf(isWithAD = True, "Success", "Failed"))
Catch ex As Exception
Console.WriteLine("Error [" + ex.ToString + "] - " + ex.InnerException.ToString)
End Try
End Sub
End Module
The syntax is: CLDAP <username> <password>.
Ex:
CLDAP john_smith 12345
CLDAP "john_smith" "12345"
CLDAP 'john_smith' '12345'
All examples are valid and return a true value. Caret character can be accepted if it is placed in the beginning or in the middle of the password. But, if a caret character is placed at the end of the password, that's where the problem starts 
|
|
|
|
|
You just need to put the password in double quotes:
cldap userid "passwd^"
|
|
|
|
|
Normally, you would never type a password on the command line.
You would prompt for it from the application after it's launched. The application can then accept the password without exposing it, replacing characters on screen with some other character or none at all.
|
|
|
|
|
Hi,
I can find the headertext with
Dim lvg As New LVGROUP()
lvg.cbSize = CUInt(Marshal.SizeOf(lvg))
lvg.mask = LVGF_STATE Or LVGF_GROUPID Or LVGF_HEADER Or LVGF_FOOTER
Dim nRetHeader2 As Integer = SendMessage(m.HWnd, LVM_GETGROUPINFO, nItem, lvg)
Dim sHeadText As String = Marshal.PtrToStringUni(lvg.pszHeader)
Dim sFootTxt As String = Marshal.PtrToStringUni(lvg.pszFooter)
however the foottext is always empty.
same for pszDescriptionTop and pszDescriptionBottom
I set the footer with some code I found on the net
Private Shared Sub SetGrpFooter(ByVal lstvwgrp As ListViewGroup, ByVal footer As String)
If Environment.OSVersion.Version.Major < 6 Then Return
If lstvwgrp Is Nothing OrElse lstvwgrp.ListView Is Nothing Then Return
If lstvwgrp.ListView.InvokeRequired Then
lstvwgrp.ListView.Invoke(New CallbackSetGroupString(AddressOf SetGrpFooter), lstvwgrp, footer)
Else
Dim GrpId As System.Nullable(Of Integer) = GetGroupID(lstvwgrp)
Dim group As New LVGROUP
group.CbSize = Marshal.SizeOf(group)
If (footer = String.Empty) Then
group.PszFooter = Nothing
Else
group.PszFooter = footer
End If
'lstvwgrp.HeaderAlignment = HorizontalAlignment.Center
'group.pszDescriptionBottom = "bottom" & Chr(0)
'group.pszDescriptionTop = "top"
<pre>
group.mask = ListViewGroupMask.Footer + ListViewGroupMask.DescriptionBottom + ListViewGroupMask.DescriptionTop
Dim ip As IntPtr = Marshal.AllocHGlobal(group.cbSize)
Marshal.StructureToPtr(group, ip, False)
If GrpId IsNot Nothing Then
group.IGroupId = GrpId.Value
SendMessage(lstvwgrp.ListView.Handle, LVM_SETGROUPINFO, GrpId.Value, ip)
Else
group.iGroupId = GrpId
SendMessage(lstvwgrp.ListView.Handle, LVM_SETGROUPINFO, GrpId.Value, ip)
End If
End If
End Sub</pre>
I also can't find the rectangles of where I have to draw the texts
What do I do wrong?
Jan
|
|
|
|
|
Where are the programmers geniusses from before?
|
|
|
|
|
JR212 wrote: Where are the programmers geniusses from before? Same place they always are. What is your problem?
|
|
|
|
|
Still the same as described in this topic. I need to find out what the footertext is in a listviewgroup in a .dotnet4 program throu user32.dll sendmessage.
Header is no problem but footer alway return 'nothing'
Jan
modified 18-Jun-21 5:30am.
|
|
|
|
|
|
Hi
Sorry but your first link is for the listviewfooter and not listviewGROUPfouter. I gues I need ListView_GetGroupInfo macro (commctrl.h) - Win32 apps | Microsoft Docs but I cant get that to work.
Your question why not use the default control. I do (partely)! I need to work with ownerdraw and the Listview control in dotnet doesn't have support for the groupfooter or the description(top nor bottom). If using dot core 5.0 I can but I need to work with 4.7 or less.
I'm been looking for weeks and can't find a working example for the groupfooter. I can if it is normaldraw so I have a code to set the footer but not to get/retrieve it.
Jan
|
|
|
|
|
|
your absolutly 100% right. But I can't get it to work
modified 24-Jun-21 2:19am.
|
|
|
|
|
JR212 wrote: But I can get it to work Well I am afraid that no one here has any chance of guessing what that means.
|
|
|
|
|
Hi
I've created my own listview with lots of extra options. like colored headers.
Thats where I have a small proplem.
What code has the icon at the right of the header for collapse/expand. I've tryed with this enum
Enum HeaderIconOpenCloseType
'open
arrow1 = 8679
triangle1 = 8711
V1 = 8744
small_v1 = 8964
'closed
arrow0 = 8681
triangle0 = 8710
V0 = 8743
small_v0 = 8963
End Enum
But none of them are exactly the same as the icon the base listview uses.
Small_V commes closes to the real one
Jan
|
|
|
|
|
how to code for clear button and cslculate button
|
|
|
|
|
Start by writing down what you want the buttons to do. Then write the code to do that.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I use
...
.ListItems(RM).SubItems(D) = ""
.ListItems(RM).ListSubItems(D).ReportIcon = 1
...
the column are just set to center.
modified 21-May-21 8:58am.
|
|
|
|
|
What is your question?
And please don't shout.
|
|
|
|
|
Sorry me.
i need to center icon in a column of listview.
part of code
...
.ListItems(RM).ListSubItems(D).ReportIcon = 1
...
note:
the columns are just set to center align.
|
|
|
|