CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Cashe pasword

  1. #1
    Join Date
    May 2001
    Posts
    23

    Cashe pasword

    Can u tell api function for retriving windows cache passwords


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Cashe pasword


    'module


    Declare Function WNetEnumCachedPasswords Lib "mpr.dll" (byval s as string, byval i as Integer, byval b as Byte, byval proc as Long, byval l as Long) as Long
    Type PASSWORD_CACHE_ENTRY
    cbEntry as Integer
    cbResource as Integer
    cbPassword as Integer
    iEntry as Byte
    nType as Byte
    abResource(1 to 1024) as Byte
    End Type

    public Function callback(X as PASSWORD_CACHE_ENTRY, byval lSomething as Long) as Integer

    Dim nLoop as Integer
    Dim cString as string
    Dim ccomputer
    Dim Resource as string
    Dim ResType as string
    Dim Password as string
    ResType = X.nType

    for nLoop = 1 to X.cbResource

    If X.abResource(nLoop) <> 0 then
    cString = cString & Chr(X.abResource(nLoop))
    else
    cString = cString & " "
    End If

    next

    Resource = cString
    cString = ""

    for nLoop = X.cbResource + 1 to (X.cbResource + X.cbPassword)

    If X.abResource(nLoop) <> 0 then
    cString = cString & Chr(X.abResource(nLoop))
    else
    cString = cString & " "
    End If

    next

    Password = cString

    cString = ""
    'for only the dialup passwords activate next line
    'If X.nType <> 6 then GoTo 66
    Form1.List1.AddItem " R: " & Resource & " P: " & Password
    66
    callback = true
    End Function

    public Sub GetPasswords()

    Dim nLoop as Integer
    Dim cString as string
    Dim lLong as Long
    Dim bByte as Byte
    bByte = &HFF
    nLoop = 0
    lLong = 0
    cString = ""
    Call WNetEnumCachedPasswords(cString, nLoop, bByte, AddressOf callback, lLong)
    End Sub


    'call from the form
    form has Command1 button and List1

    private Sub Command1_Click()
    Call GetPasswords
    End Sub




    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    May 2001
    Posts
    23

    Re: Cashe pasword

    Thank you very much for telling pssword retrival from cashe Its working fine for win95 annd 98but nor on NT Can U tell me Th Reson ?
    Any wayy I have one Question for u If u dont mind from where u get all info about API well I was Trying o understand this code but useless i could nt understand but it is working fine for 95 and 98


  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Better post this...

    ...Under Iouri answer, or he will not be informed you post something for his reply. Simply go to Ioury answer, and post your post as a reply to it (up-left corner: a button with "reply to this message").

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    May 2001
    Posts
    23

    Re: Cashe pasword

    Thank you very much for telling pssword retrival from cashe Its working fine for win95 annd 98but nor on NT Can U tell me Th Reson ?
    Any wayy I have one Question for u If u dont mind from where u get all info about API well I was Trying o understand this code but useless i could nt understand but it is working fine for 95 and 98



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured