Python到VB.NET-使用Tor检查URL
我用python编写了以下代码。脚本使用Tor专家包来检查使用Tor的链接 是否可以在VB.NET中编写此代码?我不确定vb.net的功能Python到VB.NET-使用Tor检查URL,python,vb.net,Python,Vb.net,我用python编写了以下代码。脚本使用Tor专家包来检查使用Tor的链接 是否可以在VB.NET中编写此代码?我不确定vb.net的功能 #Tor Onion links Active Status checking import os import requests import json import time import subprocess class TorActivation: def __ini__(self): pass def Start
#Tor Onion links Active Status checking
import os
import requests
import json
import time
import subprocess
class TorActivation:
def __ini__(self):
pass
def StartTor(self):
subprocess.Popen([f"{os.getcwd()}\\Tor\\tor.exe"])
time.sleep(10)
print("Tor Proxy has been started!!")
print("Starting Process of Checking")
def proxy_build(self):
try:
self.proxies = {
'http': 'socks5h://127.0.0.1:9050',
'https': 'socks5h://127.0.0.1:9050'
}
print("proxy setup is succefully done")
except:
print("Tor is not activated please run the program again!!!")
def check(self,onion,save):
print()
try:
data = requests.get(f"http://{onion}",proxies=self.proxies)
status=data.status_code
except:
status=404
if status==200:
print(f"{onion} : Active")
print(f"Status Code : {status}")
else:
print(f"{onion} : nonActive")
print(f"Status Code : {status}")
if save==True:
w=open("Status.txt","a")
if status==200:
w.write(f"http://{onion} : Active")
else:
w.write(f"http://{onion} : nonActive")
w.close()
print()
return
if __name__ == "__main__":
run=TorActivation()
run.StartTor()
run.proxy_build()
while True:
print("1. Single Url Checking")
print("2. Multiplt Url Checking")
print("3. Quit")
option=input("Enter your option: ")
if str(option)=='1':
onion=input("Enter the url: ")
run.check(onion,False)
elif str(option)=='2':
filename=input("Enter the txt filename: ")
f=open(filename, "a")
f.readlines()
for x in f:
x=x.rstrip("\n")
run.check(x,True)
f.close()
elif option=='3':
break
回答你的问题;是的,您可以(轻松地)在VB.Net中实现这一点。欢迎来到堆栈溢出。请回顾,和中的主题。我们不是来为你写(或翻译)代码的,我不想让你写。我在问是否可能。请再读一遍这个问题,这真的是你想知道的吗?让别人说“是”或“不是”?我对此表示怀疑。是的,正如问题所述。我们在这里不是为了阅读整个代码并确定它是否可以用另一种语言编写(这实际上需要我们在头脑中编写代码)。是的,这是可能的。毕竟,Python和VB.NET都是图灵完备的。但这不是一件很有用的事情。我可以说,我不知道任何VB.NET,甚至不阅读您上面共享的代码。