How do I get the computer name?

We have an application that is run on either the user's local machine or the
server.  I can get the local computer name using
n_cst_platform.of_getComputerName(), but how do I get the server name will
that function work as well?

TIA


0
Rob
8/5/2003 1:12:20 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

3 Replies
483 Views

Similar Articles

[PageSpeed] 29

> We have an application that is run on either the user's
> local machine or the server.  I can get the local computer
> name using n_cst_platform.of_getComputerName(), but how do
> I get the server name will that function work as well?
>
> TIA
>
>

Are you just trying to determine if it is being run on a
loal drive or a network drive?  If so, usiNG PFC:

String ls_drive

//0 Undetermined drive type
//1 Root directory does not exist
//2 Removable disk
//3 Nonremovable disk
//4 Remote (network) drive
//5 CD-ROM drive
//6 RAM disk

lui_drivetype =
gnv_app.inv_filesrv.of_GetDriveType(ls_drive)

if lui_driveType = 4 then
	li_ret = MessageBox("System","The App is Being Run From the
Network")
End IF

- Joe Slawsky (NOSPAMFORME_jslawsky@planetdx.com)
www.planetdx.com
0
Joe
8/5/2003 3:43:46 PM
> Are you just trying to determine if it is being run on a
> loal drive or a network drive?  If so, usiNG PFC:
>
> String ls_drive
>
> //0 Undetermined drive type
> //1 Root directory does not exist
> //2 Removable disk
> //3 Nonremovable disk
> //4 Remote (network) drive
> //5 CD-ROM drive
> //6 RAM disk
>
> lui_drivetype =
> gnv_app.inv_filesrv.of_GetDriveType(ls_drive)
>
> if lui_driveType = 4 then
> li_ret = MessageBox("System","The App is Being Run From the
> Network")
> End IF

I actually need the UNC name because some users may have different drive
mappings.  If I use the GetModuleFileNameA API call, it returns the path
using the mapped drive letter.  What I need is the server name for example:
\\server1\apppath\app\app.exe


0
Rob
8/5/2003 4:21:36 PM
> I actually need the UNC name because some users may have different
> drive mappings.  If I use the GetModuleFileNameA API call, it returns
> the path using the mapped drive letter.  What I need is the server name
> for example: \\server1\apppath\app\app.exe

Try this :
http://www.rgagnon.com/pbdetails/pb-0131.html

Bye.
-- 
| Real Gagnon  from  Quebec, Canada
+ LookingForJavaOrPowerBuilderSnippets? VisitReal'sHow-to
| http://www.rgagnon.com/howto.html

0
Real
8/5/2003 5:11:45 PM
Reply:

Similar Artilces:

How to get DNS Name be the DNS Name rather than computer name
In Patchlink associated with computers there is "DNS Name" field. This field seems to be the computer name (netbios name) for windows computers rather than the dns name assocated with the IP address. Is there a way to configure the patchlink server so this field reports the DNS Name rather than the computer name? where is that "DNS name" field? -- Shaun Pond > where is that "DNS name" field? > > -- > > Shaun Pond > > From the web interface: 1) From the Reports ->Computer Status Report the second field ins...

How can i get the computer client computer name not the IP address
I have been trying to get the client computer name and ip address. For the IP address i can get it. For the computer name i a gain get the IP address. Is there some thing i have to do in order to get the computer name not the IP. My application runs on a server in the company's intranet. Below is my sample code. I also want to get the "timea" just in hour/minutes format. At the moment timea is bringing to much details(I dont if there seconds or millisecoinds, but just to much figures) Dim username As String = HttpContext.Current.User.Identity.Name Dim timea As String = DateTime.Now.TimeOf...

Get Computer Name
How to get the computer name in Win95 and Win3.1(workgroup)? Thanks in advance. Do any web site that contain all Window API calls, thanks. Edward Chan For Win95: FUNCTION ulong GetComputerNameA( REF string lpBuffer, REF ulong nSize ) LIBRARY "kernell32.dll" Roy se5a03 wrote in message <3522454C.2CB87E94@hotmail.com>... >How to get the computer name in Win95 and Win3.1(workgroup)? > >Thanks in advance. > >Do any web site that contain all Window API calls, thanks. > >Edward Chan > se5a03 a �crit dans le message <35...

How to get computer name?
How do I get the computer name from a vb.net 2.0 program?TIA,Owen Ok. I Found it.My.Computer.Name Owen...

Get computer name
I found the code below in an old Google session for this newsgroup. I am just wondering if the GetComputerNameA Win32 API works in 95, 98, 2000 and XP. Anyone? To get the computer name, use the GetComputerNameA Win32 API call as follows: FUNCTION boolean GetComputerNameA( REF string lpBuffer, REF ulong lpnSize ) LIBRARY "kernel32.dll" // sample code string ls_name ulong lul_maxlen lul_maxlen = 260 ls_name = Space( lul_maxlen ) IF NOT GetComputerNameA( ls_name, lul_maxlen ) THEN // handle the error ELSE MessageBox( "Computer Name", ls...

get names of computer and their users
Hello, is there a way to get all the computers and their users in a domain? Thnx, geert I use NetQueryDisplayInformation http://msdn.microsoft.com/library/en-us/netmgmt/netmgmt/NetQueryDisplayInformation.asp?frame=true A good example can be found here http://www.topwizprogramming.com/redirect.html?page=freecode > Hello, > > is there a way to get all the computers and their users in > a domain? > > > Thnx, > > geert ...

How can I get the computer name?
hi, somebody there can help me please? I'm new in ASP.NET, I'm working in something where I need get the client computer name....how can i do that?........I think it could be possible with some script. Ask the user. there's no easy way to just get this automatically.RTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unreadableJason Brown - MVP, IIS...

How can I get a computer name
Hi! How can I get a computer name, which is running my application? Sancho Sandris The platform service of the PFC has an of_GetComputerName() function. Good Luck Michael Walker Cascadia Software Sandris wrote: > Hi! > How can I get a computer name, which is running my application? > > Sancho > > > ...

Getting Computer Login Name.
  Hi all I'm using VWD Im trying to get the computer Login Name(Username) in my web application. I tried using HttpContext.Current.User.Identity.Name and alot of other way like the old method servervariables? and many other. But cannot rem them no. All of it works IF im working local Host. But it Just Became Empty or Wrong Value if its working on a server/client basis.   And ideas how to get it using web Application?   Thx in advance Cheers Did you tried just User.Identity.Name and what you got! Also what value it's showing. One more quesiton, are you using forms ...

get computer name in a network
Hello, I'm trying to get the computername from which a user has been logged in from. Is there a way to do this??????? Thnx, Geert http://eric.aling.tripod.com/PB/tips/pbtip14.htm Good luck... ;) U�ytkownik <Geert Vancleef> napisa� w wiadomo�ci news:4063fab6.370d.846930886@sybase.com... > Hello, > > I'm trying to get the computername from which a user has > been logged in from. Is there a way to do this??????? > > > Thnx, > > Geert Hi Geert, //external API declaration FUNCTION boolean GetComputerNameA(ref string ...

Get Client Computer Name
I'm attempting to retrieve the client computer name from my ASP.NET web application. I'm using System.Net.Dns.GetHostName(). This is returning the computer name of the web server. The application is being used an a Windows 2000 Active Directory Intranet. How do I get the name of the client computer, not the web server name? Thank you. Try either Request.ServerVariables["REMOTE_HOST"] for the client computername or Request.ServerVariables["REMOTE_ADDR"] for the client ip address Regards Fredr!k Close... Request.ServerVariables("remote_a...

How to get a bitmap name from a Computed Fied
I am setting a computed field to a bitmap by using the expression :: Bitmap(Case(f_find_maint(sxpr_pk, ordd_sku_cd ) WHEN IS = 1 THEN "spman.bmp" when is = 2 then "zoom.bmp" else "stop.bmp")) The problem is that I cannot access the name of the bit map in the code. Does anyone have a clue on how to get the bitmap name? Thanks Have two computed fields, the first with expression Case(f_find_maint(sxpr_pk, ordd_sku_cd ) WHEN IS = 1 THEN "spman.bmp" when is = 2 then "zoom.bmp" else "stop.bmp") and the second wit...

Getting the computer name of the client user
Is it possible to get the client's computer name?ez Ez416:Is it possible to get the client's computer name? I dont think so.I do not think a post/get request will send such information. It can be done using an ActiveX object, but the client computer's setting has to be set to a ridiculously low level.When you ask a question, remember to click "mark as answered" when you get a reply which answers your question.My latest ASP.NET AJAX blog entries. Probably it is enough to use Request.UserHostName and Request.UserHostAddress (on server-side). no?[MCPD: WEB]...

How to get computer name application is running on?
I have a Windows Service and need to be able to get the name of the computer the service is running on from code for logging purposes. How can I get that? System.Environment.MachineName should contain the information you need----------------------------------------------Mark helpful posts as "Answer"Check out my cheese making blog http://cheeseathome.blogspot.com...

Web resources about - How do I get the computer name? - sybase.powerbuilder.general

Computer - Wikipedia, the free encyclopedia
"Computer technology" and "Computer system" redirect here. For the company, see Computer Technology Limited . For other uses, see Computer (disambiguation) ...

Computer - Wikipedia, the free encyclopedia
"Computer technology" and "Computer system" redirect here. For the company, see Computer Technology Limited . For other uses, see Computer (disambiguation) ...

Computer Show
The first episode premiered at XOXO last month, and it brought the house down. I think you’re best off going in cold — just grab a beverage and ...

Computer glitch in Moncrieff land sale saw buyers told they were not eligible
Email wrongly told potential buyers they had been disqualified because of the timing of their email.

Google is ponying up a million dollars to make its cloud storage safer than your own computer's hard ...
Google just announced that it's going to commit $1 million in grants next year to fund security research that helps keep Google Drive cloud storage ...

"Backdoor" computer hack may have put government data at risk
"Potential vulnerability" was found in software used to secure government and corporate computer networks

Grub2 bootloader flaw leaves locked-down Linux computers at risk
... GRUB, which stands for the Grand Unified Bootloader, is used by most Linux distributions to initialize the operating system when the computer ...

UC under pressure to count high school computer science toward math requirement
UC under pressure to count high school computer science toward math requirement Contra Costa Times Romeo Pittman, 15, left, and Chris Arrington ...

Bipartisan education bill makes computer science a priority
... Behind act, reducing federal controls on state education systems but it does something else, too. The Ever Student Succeeds act places computer... ...

How To Buy Computers For Kids In 2016
Video When it comes to kids, adults sometimes don't realize that computers can be an avenue for creativity and open-ended play, just like a bucket ...

Resources last updated: 12/20/2015 9:33:42 AM