Sep 30th, 2004, 08:47 AM
#1
Thread Starter
Lively Member
get a file from document and settings [resolved]
i'm a flash designer and with this flash i can create some sort of cookie
this cookie wil be stored in documents and settings
i now exactly were the cookie is been stored the only problem is how can i receive it because
i have to pas a map that has the username from the person thats online
for example with me it is
c:/documents and settings/davyquyo/ .....
is there a way to receive that some sort of cookie in this map
because when i'm going to use this litle program on other pc's this name of this map won't be the same
i hope you understand me
Last edited by davyquyo; Oct 2nd, 2004 at 03:18 PM .
Sep 30th, 2004, 08:59 AM
#2
You need this done in VB?
Sep 30th, 2004, 09:02 AM
#3
Thread Starter
Lively Member
oops sorry i didn't say this
wel i creating a program with visual basic 6.0
and this program wil be running local offcourse
Sep 30th, 2004, 09:09 AM
#4
If I understand correctly, by map, you mean Folder (directory), correct? And you want to get the users profile folder path?
Like in my case it is C:\Documents and Settings\baja
Sep 30th, 2004, 09:14 AM
#5
Thread Starter
Lively Member
yes indeed,
this is the loaction i need to get
C:\Documents and Settings\davyquyo\Application Data\Macromedia\
the only problem is tis one map
i hope you van help me
Sep 30th, 2004, 09:16 AM
#6
in that case you can use API to get the username of the logged in user:
VB Code:
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
Dim strUserName As String
'Create a buffer
strUserName = String(100, Chr$(0))
'Get the username
GetUserName strUserName, 100
'strip the rest of the buffer
strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
'Show the username
MsgBox strUserName
MsgBox "C:\Documents and Settings\" & strUserName
End Sub
Sep 30th, 2004, 09:19 AM
#7
You replied before I posted... in that case you need to extract the path from this registry value:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders,AppData
and to that add: & "\Macromedia"
To get the registry value data search this forum, it has been covered many times.
Sep 30th, 2004, 09:23 AM
#8
Thread Starter
Lively Member
ok thanks for the help i wil need it
this should work
Sep 30th, 2004, 05:28 PM
#9
No problem
Sep 30th, 2004, 06:58 PM
#10
The picture isn't missing
I once installed windows without formatting, but choosing the same user name. Before i reinstalled it was like this:
John
Bob
Administrator
after, it became:
John.WINDOWS
Bob.WINDOWS
Administrator.WINDOWS
John
Bob
Administrator
The last three were left over from the install. The ones with the ".WINDOWS" was the real one. I don't know if GetUserName will compensate for that.
Remember, if someone's post was not helpful, you can always rate their post negatively
.
Sep 30th, 2004, 07:27 PM
#11
This link to one of my older threads will get the users Application Data
folder path in the Local Settings directory.
Application Data Path
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Oct 2nd, 2004, 08:32 AM
#12
Thread Starter
Lively Member
ok i try't this
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
Dim strUserName As String
'Create a buffer
strUserName = String(100, Chr$(0))
'Get the username
GetUserName strUserName, 100
'strip the rest of the buffer
strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
'Show the username
MsgBox strUserName
MsgBox "C:\Documents and Settings\" & strUserName
End Sub
this says the right name
davy
but the map is davy.davy-quyo
and then i try't this
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders ,AppData
but he givs error with the red part
are they other ways to get the right path ???
Oct 2nd, 2004, 09:12 AM
#13
Thread Starter
Lively Member
i found this
VB Code:
Private Sub Form_Load()
MsgBox Environ(8)
End Sub
this shows perfectly the path i need
except for the homepath variable
how do i remove the first 9 letters
Oct 2nd, 2004, 09:46 AM
#14
Thread Starter
Lively Member
i found it
i used this
VB Code:
Private Sub Form_Load()
Dim test2
test2 = Replace(Environ(8), "HOMEPATH=", "")
MsgBox test2
End Sub
this work
Oct 2nd, 2004, 10:13 AM
#15
No. Its usually bad programming to depend upon something that
can be changed or deleted like enviroment variables.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Oct 2nd, 2004, 02:04 PM
#16
Thread Starter
Lively Member
i lookd to the thing you posted bt i can't figure how it works how ill you do it then
Oct 2nd, 2004, 02:51 PM
#17
I made a working example of how to get the Application data
path under the users profile. Just add to the path to build
anything else you need.
Attached Files
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Oct 2nd, 2004, 03:03 PM
#18
Thread Starter
Lively Member
this is great tahnks a lot really
sorry for the trouble
Oct 2nd, 2004, 03:09 PM
#19
No trouble at all. Just hard code to get your path using the CSIDL_APPDATA
and add the \Macromedia" folder to the results.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Oct 2nd, 2004, 03:11 PM
#20
Thread Starter
Lively Member
some results are empty
but i think evrything i need is fine
tank you very much
Oct 2nd, 2004, 03:16 PM
#21
Some are empty because they are virtual folders like the Control Panel, etc.
Don't forget to resolve this thread if all has been answered.
Later.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width