Jump to content

Beginner's two question


CrazyU
 Share

Recommended Posts

1.How alone obtains IP address fourth section of ?

192.168.1.22,So long as 22 does not want 192.168.1.22

2.

$var = DriveGetDrive( "CDROM" )

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey", "REG_SZ", "$var")

Why after run this script the TestKey value is the blank, but is not CDROM path?

English not good ^-^

Link to comment
Share on other sites

1.How alone obtains IP address fourth section of ?

192.168.1.22,So long as 22 does not want 192.168.1.22

2.

$var = DriveGetDrive( "CDROM" )

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey", "REG_SZ", "$var")

Why after run this script the TestKey value is the blank, but is not CDROM path?

English not good ^-^

I have no clue what you are asking in your first question - but your second question should put the work $var in the key as you have it in quotes - variables should not be used in quotes. Your other issue if you use msgbox() to check and see what $var is you will see nothing as the DriveGetDrive returns an array. Try $var[1] that should give you the drive letter.

-EDIT - Beat again :0

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

1.How alone obtains IP address fourth section of ?

192.168.1.22,So long as 22 does not want 192.168.1.22

English not good ^-^

I think he wants to know how to keep only the fourth part of an IP address (trim off the first three).

$number= StringSplit($YourIP, ".")

$number[4] will contain your number.

English not so bad :whistle:

"When I get angry, Mr. Bigglesworth gets upset. And when Mr. Bigglesworth gets upset... people die!" --DrEvil

Link to comment
Share on other sites

or:

MsgBox(0, "", StringTrimLeft(@IPAddress1, StringInStr(@IPAddress1, ".", 0, -1)))oÝ÷ ØGb·Z+jëh×6MsgBox(0, "", StringRight(@IPAddress1, StringInStr(@IPAddress1, ".", 0, 1) - 1))

Edit2: StringSplit works well enough - I was just attempting to throw @IPAddress1 into the mix and I thought while I was at it, I would show those string functions as well.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...