Click here to Skip to main content
15,885,740 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Convert Python to vb.net


What I have tried:

username = input("Enter your username : ")
password = input("Enter your password : ")
 
        hd2 = {
    'User-Agent': 'Instagram 113.0.0.39.122 Android (24/5.0; 515dpi; 1440x2416; huawei/google; Nexus 6P; angler; angler; en_US)',
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Accept-Language": "en-US",
    "X-IG-Capabilities": "3brTvw==",
    "X-IG-Connection-Type": "WIFI",
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    'Host': 'i.instagram.com'
 
 
    data = {'uuid': uid,
        'password': password,
        'username': username,
        'device_id': uid,
        'from_reg': 'false',
        '_csrftoken': 'missing',
        'login_attempt_count': '0'}    
    url = 'https://i.instagram.com/api/v1/'
            endpoint = 'accounts/login/'
    ss = requests.session()
            endpoint2 = 'users/check_username/'  
        def check1(user):
      #suggestions
    data2 = {
            "_uuid":uid,
            "username":f"{user}",
            "_csrftoken":ss.cookies['csrftoken']
        }
    re = requests.post(url + endpoint2,data=data2,headers=hd2).text
    return not "suggestions" in re
 
def work():
 
    log = ss.post(url + endpoint, data=data, headers=hd2)
    if ('{"logged_in_user":') in log.text:
        print("Logged in @" + username)
        ss.cookies = log.cookies
    else:
        exit(0)
    slp = int(input("Enter sleep: "))
    listf = input("file name:")
    listuser = open(listf,"r").read().splitlines()
    for user in listuser:
 
             if check1(user):
                print(f"{user} = 14 Days")
              else:
                print(f"{user} = Hmm No")
              else:
            print(f"{user} = Not Banned")
        sleep(slp)
 
 
work()
Posted
Updated 10-Feb-20 2:40am
Comments
Maciej Los 10-Feb-20 8:37am    
What's your question?
Dave Kreskowiak 10-Feb-20 11:34am    
If you're looking for someone to convert the code for you, that's not going to happen.
das asd 2023 5-Apr-23 8:50am    
import logging
import socket

logging.basicConfig(level=logging.DEBUG, format='%(threadName)s: %(message)s')
host_ip = '192.168.0.10' # PLCのIPアドレス
host_port = 8501

logging.debug('start')
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# socket.AF_INETでip4を使うことを指定。socket.SOCK_STREAMでTCPを使うことを指定。

try:
#クライアント接続
client.connect((host_ip ,host_port)) # サーバーに接続(kv-7500にTCP接続/上位リンク通信)
except:
print("PLC接続NG")

comandD100 = "RD DM100.U\r"
#comandD200 = "RDS DM200.U 200\r"
#comandM100 = "RD MR200.S 3\r"


ascii_comandd100 = client.send(comandD100.encode("ascii"))
#ascii_comanm100 = client.send(comandM100.encode("ascii"))
#ascii_comand200 = client.send(comandD200.encode("ascii"))
print("send : " + str(ascii_comandd100))


response = client.recv(32) #受信用バイト配列を定義しておく(responseのバイト数以上を設定しておく)
print(response)
response = response.decode("UTF-8") # PLCからの返答がbyteデータなのでUTF-8にデコード

client.close()

print("Received :" ,response)
logging.debug('end')

1 solution

Everything in your "What I have tried:" section is Python not VB.NET

Try using one of these on line converters[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900