- Jun 12, 2001
- 8,757
- 43
- 91
</sigh>
So I have been searching for this but I wonder if I am searching incorrectly on the web, maybe I'm not using the right words.
It's pretty simple. I have this coding to query a Windows computer of their IP address:
What I'd like to do is pull the third octet from Text and use it as a URL. Basically, I'd first (I wish I could just use grep...) get the third octet by:
But I'm not getting that to work. But if I did, I'd like to then put the variable into an HTML page anchor tag, which I hope is right:
I am far off? Thank you for any help.
So I have been searching for this but I wonder if I am searching incorrectly on the web, maybe I'm not using the right words.
It's pretty simple. I have this coding to query a Windows computer of their IP address:
Code:
<script>
var objLocator = new ActiveXObject("WbemScripting.SWBemLocator");
var objService = objLocator.ConnectServer(".","root\\CIMV2");
instances = objService.ExecQuery(
"SELECT Caption, IPAddress, MACAddress "
+ "FROM Win32_NetworkAdapterConfiguration");
e = new Enumerator(instances);
var Text = ""
for(;!e.atEnd();e.moveNext())
{
nic = e.item();
if(nic.IPAddress!=null)
{
var ipArray = VBArray(nic.IPAddress).toArray();
// Text = Text + nic.Caption+"--"+nic.MACAddress+"--"+ipArray[0]+"<br>";
Text = Text + ipArray[0]+"<br>";
}
}
document.write(Text);
</script>
What I'd like to do is pull the third octet from Text and use it as a URL. Basically, I'd first (I wish I could just use grep...) get the third octet by:
Code:
Function CodeTML(Text As String) {
Dim MyArray() As String
MyArray = Split(Text, ".")
CodeTML = MyArray(2)
}
But I'm not getting that to work. But if I did, I'd like to then put the variable into an HTML page anchor tag, which I hope is right:
Code:
<a class="w3-bar-item w3-button w3-text-white" href="pages/"+'CodeTML'+.html" target="_blank">Support</a>
I am far off? Thank you for any help.