| |

VerySource

 Forgot password?
 Register
Search
Author: rgf2008

Two super depressing questions

[Copy link]

0

Threads

17

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-6-9 11:30:01
| Show all posts
'Change IP to say
The following script is saved as a *.vbs file, and you can change the IP, subnet mask, and gateway by double-clicking it.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\"&strComputer&"\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")

strIPAddress = Array("192.168.0.12")
strSubnetMask = Array("255.255.255.0")
arrDefaultGateways = Array("192.168.0.1")
arrGatewayCostMetrics = Array(1)


For Each objNetAdapter in colNetAdapters
    errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
    errEnable = objNetAdapter.SetGateways(arrDefaultGateways, arrGatewayCostMetrics)

Next

WScript.Echo "Static IP address already enabled."
Reply

Use magic Report

1

Threads

10

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-6-15 11:00:01
| Show all posts
The problem of deleting cookies is basically solved. The file "index.dat" in the cookies folder cannot be deleted. I had to bypass it.

The following code does it:
string strUserName = System.Environment.UserName;
          string strCookiesPath = @"C:\Documents aSettings\"+strUserName+@"\Cookies";
            foreach (string strFileName in Directory.GetFiles(strCookiesPath))
            {
                if (strFileName.ToLower().IndexOf("index.dat")==-1)
                {
                    File.Delete(strFileName);
                }
            }
Reply

Use magic Report

1

Threads

10

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-6-22 19:30:01
| Show all posts
The .vbs code provided by22151146seems to be not easy to use~ After running, the Internet is not available anymore.
Reply

Use magic Report

1

Threads

10

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-6-24 22:45:01
| Show all posts
The IP of ADSL dialing may be different each time.
The question I want to solve now is, how to use the program to control ADSL redial? To get a new random IP

Master help~~
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list