computer-name

Get the Computer Name Using Javascript/Jquery

試著忘記壹切 提交于 2021-02-05 08:30:50
问题 I want to get the computer name using jquery. I tried using ActiveX Object but it will only run on IE browser. Is there is another way to get the computer name using jquery. I tried that code. var network = new ActiveXObject('WScript.Network'); alert(network.computerName); Can u any one help me.. 回答1: You can't. This information is not available to web sites. The ActiveX approach outlined in your question won't even work in current versions of Internet Explorer, as the WScript.Network ActiveX

Is it possible to use computer name in iptables

雨燕双飞 提交于 2020-01-15 08:54:29
问题 I want to redirect some port from WAN to my laptop. The problem is, that the laptop has different IP on wireless as on cable LAN. Is there a way to use the computer name in iptables? Iptables port forwarding rule (using IPs) should be: iptables -t nat -A PREROUTING -p tcp -d 192.168.102.37 --dport 422 -j DNAT --to 192.168.102.37:22 Can I write something like iptables -t nat -A PREROUTING -p tcp -d mycomputername --dport 422 -j DNAT --to mycomputername:22 and the computer name will be resolved

Changing the computer name with Inno Setup

≯℡__Kan透↙ 提交于 2020-01-01 19:39:16
问题 Is there a way to change your computer name with Inno Setup? I'm new to Inno Setup but I searched quite alot and I haven't found any example of it. I know you can access the computer name with the constant {computername} , but it seems like there is no function to change it. I thought about changing the registry key of the computer name in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName with section [Registry] , but I don't know what will happen if I use

What's the best method for getting the local computer name in Delphi

依然范特西╮ 提交于 2019-12-22 05:59:27
问题 The code needs to be compatible with D2007 and D2009. My Answer: Thanks to everyone who answered, I've gone with: function ComputerName : String; var buffer: array[0..255] of char; size: dword; begin size := 256; if GetComputerName(buffer, size) then Result := buffer else Result := '' end; 回答1: The Windows API GetComputerName should work. It is defined in windows.pas. 回答2: Another approach, which works well is to get the computer name via the environment variable. The advantage of this

Get full computer name from a network drive letter in python

那年仲夏 提交于 2019-12-10 04:19:07
问题 I am using python to populate a table with the file pathways of a number of stored files. However the pathway needs to have the full network drive computer name not just the drive letter, ie //ComputerName/folder/subfolder/file not P:/folder/subfolder/file I have investigated using the win32api, win32file, and os.path modules but nothing is looking like its able to do it. I need something like win32api.GetComputerName() but with the ability to drop in a known drive letter as an argument and

How to get the computer name using the IP Address [closed]

风流意气都作罢 提交于 2019-12-08 07:50:36
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am trying to get the computer name for the current user. I am able to get the IP address using System.Net.Dns.GetHostEntry("ComputerName").Address.ToString() but when I replace the *ComputerName*with the IPAddress I receive the following error. No such host is known I enabled reverse DNS in IIS7 by running

How to get the user set computer name using python in MacOS Sierra/High Sierra

人盡茶涼 提交于 2019-12-06 06:04:50
问题 The question below has partly been answered, see the Solution section below. So I'm posting this partly to help others and also since the solution I have hasn't really solved the problem yet. Question So, the question is why the hostname as given by the following techniques (using python's platform and socket libs) gives different host names depending on which router you are attached to and why its also different to the computer name and also local host name. This is very mac specific too by

Changing the computer name with Inno Setup

拜拜、爱过 提交于 2019-12-04 19:17:09
Is there a way to change your computer name with Inno Setup? I'm new to Inno Setup but I searched quite alot and I haven't found any example of it. I know you can access the computer name with the constant {computername} , but it seems like there is no function to change it. I thought about changing the registry key of the computer name in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName with section [Registry] , but I don't know what will happen if I use the syntax to create a new key. Will it overwrite it? Will it throw me an error? Any ideas would be

How to get the user set computer name using python in MacOS Sierra/High Sierra

China☆狼群 提交于 2019-12-04 09:56:01
The question below has partly been answered, see the Solution section below. So I'm posting this partly to help others and also since the solution I have hasn't really solved the problem yet. Question So, the question is why the hostname as given by the following techniques (using python's platform and socket libs) gives different host names depending on which router you are attached to and why its also different to the computer name and also local host name. This is very mac specific too by the way. Firstly, I am using a MacBook pro 2015 model with High Sierra 10.13.6. I use terminal and do

javascript is not giving the computer name

末鹿安然 提交于 2019-12-02 03:56:34
问题 I am Trying to Get the Client Computer name using javascript like this <script language="javascript" type="text/javascript"> function GetComputerName() { try { var network = new ActiveXObject('WScript.Network'); alert(network.computerName); } catch (e) { alert('a'); } } </script> But this is not returning any thing else exception.Plz Help me to find out the client computer name in Javascript. 来源: https://stackoverflow.com/questions/14579752/javascript-is-not-giving-the-computer-name