Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Environment Variables


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-22-2008, 04:10 PM
Junior Member
 
Join Date: May 2008
Location: Newcastle Upon Tyne - England
Posts: 49
Default Environment Variables

In the desktop build, I'm trying to use the likes of %USERPROFILE% and its not working. I know with those environment variables you can find out the username (as in user-id), but there's a persons full name that I'd prefer to grab if anyone can help. Is it a registry call?
Reply With Quote
  #2 (permalink)  
Old 05-22-2008, 04:36 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

The door library comes to the rescue:
obj is an Object.
Code:
Sub App_Start
    Form1.Show
    obj.New1(false)
    obj.CreateNew("System.Environment")
    fullPath = GetPath("%USERPROFILE%")
    Msgbox(fullPath)
End Sub

Sub GetPath (env)
    Return obj.RunMethod2("ExpandEnvironmentVariables",env,"System.String")
End Sub
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
program variables tremara1 Questions & Help Needed 2 10-16-2008 08:52 AM
automatic typecasting of variables? Stellaferox Questions & Help Needed 4 02-04-2008 01:17 PM
Help about variables/objects skipper Questions & Help Needed 6 12-19-2007 04:45 PM
Dim-ing variables colin9876 Questions & Help Needed 8 11-17-2007 06:47 PM
Structure variables Erel Code Samples & Tips 0 05-19-2007 11:36 AM


All times are GMT. The time now is 01:53 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0