Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - Mi4night

#1
Okay after i haven't posted anything for so long now, i coded this 2 days while I'm learning some python this Account Checker Script it works Pretty simple the script's speak's for itself.
To run it you need Python 3.1.
Let me know if you like it, or think there's something i can improve or add.
The single account check is pretty ugly yet need to read more about formating string in Python till then here it is.
(Rapidshare API makes life easier ;))
#!/usr/bin/python3
import os, sys,urllib.request

#Checking what platform we're running on to perform CLI cleaning.
if sys.platform == ('win32' or 'win64'): os.system('cls')
elif sys.platform == ('linux' or 'linux2'): os.system('clear')

print('#----------------------------------------------------------------------#')
print('# Script Name : Rapidshare Account Checker v0.1                        #')
print('# Author      : Mi4night                                               #')
print('# E-Mail      : mi4night@hotmail.com                                   #')
print('# Purpose     : rsc.py rchecklist.txt | or simply exec script          #')
print('# Usage       : At your own risk                                       #')
print('# List Format : username:password and new line                         #')
print('#----------------------------------------------------------------------#\n')

def main():
   if len(sys.argv) == 1:
      PromptedExec()
   else:
      ListCheck(sys.argv[1])

def PromptedExec():#Prompt User for Input to get Account Informations.
   Username = input("Please enter your Username:")
   Password = input("Please enter your Password:")
   print('--------------------------------------')

   try:
      if len(Username) and len(Password) != 0:
         Response = urllib.request.urlopen("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login="+Username+"&password="+Password)
         ResOut = Response.read()
         Response.close()

         if len(ResOut) < 44:
            print('Login failed.')
         else:
            List = ResOut
            for Items in List.split():
                print(Items)
             
           
      else:
         print ("You forgot to enter your Username or Password")
         sys.exit(0)
   except:
         print('Error Accured!')
     
def ListCheck(FileName):#Check's a list with account's if there broken or still working.

   try:
       CurrDir = os.getcwd() + '\\'
       FileHwnd = open(CurrDir + FileName)
   
       for line in FileHwnd.readlines():
           sBuffer = line
           AccountInfo = sBuffer.split(':')
           RsUsername = AccountInfo[0]
           RsPassword = AccountInfo[1]
           Response = urllib.request.urlopen("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=getaccountdetails_v1&type=prem&login="+RsUsername+"&password="+RsPassword)
           ResOut = Response.read()
           Response.close()

           if len(ResOut) < 44:
              print('Username:{} Password:{} is not working. :('.format(RsUsername,RsPassword))
              print('------------------------------------------------------------------------')
           else:
              print('Username:{} Password:{} is working!'.format(RsUsername,RsPassword))
              print('------------------------------------------------------------------------')

              #Open File and write/append all working account's in it.
              File = open(CurrDir + 'Working Accounts.txt','a')
              File.writelines(RsUsername + ':' + RsPassword + '\n')

       print("\nAll working account's have been saved in the file (Working Account's.txt)")
       print("*************************************************************************")
       print("For suggestion's found bugs and idea's mail me mi4night@hotmail.com")

   except:
         print('Error Accured!')

   
if __name__ == '__main__':main()



#2
Okay first off all Hi! all.
Okay My question is how can i create for example a Progressbar from a Image Pattern.
I know that you can't yet understand what i mean as my english is pretty poor but let me try to explain

for example i don't not load big progressbar images into my application to create a progressbar so i want use this little image here

and set it's length but i don't want to lose quality of the image by streching it so how is it possible to copy and past it over and over again until i get my disired length.
I hope i understand what i mean to say thx for any help
#3
Programación Visual Basic / [Snippet]Suicide
27 Julio 2010, 00:53 AM
Okay a thew minutes ago i was looking at some Delphi codes i had and found one that i thought why not to port it to vb6 the credit's go to Counterstrikewi  as he is the original Delphi Coder cheers
Option Explicit
'---------------------------------------------------------------------------------------
' Function    : Suicide
' DateTime    : 26.07.2009  12:23AM
' Author      : Mi4night
' Mail        : mi4night@hotmail.com
'Credits        : Counterstrikewi  
' Purpose     : A Simple Melt function that i ported from delphi,call it on the form unload event.
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
'---------------------------------------------------------------------------------------
Const SW_HIDE = 0
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long
Private Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function GetEnvironmentVariable Lib "kernel32" Alias "GetEnvironmentVariableA" (ByVal lpName As String, ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long

Public Function Suicide() As Boolean
   Dim FilePath As String * 255
   Dim CMD      As String * 255
   Dim Lng      As Long
   Suicide = False

   If GetModuleFileName(0, FilePath, 256) <> 0 Then
       Lng = lstrlen(FilePath)
       
       GetShortPathName FilePath, FilePath, Lng
       lstrcpy CMD, "/c del "
       lstrcat CMD, FilePath
       lstrcat CMD, " >> NUL"

       If (GetEnvironmentVariable("ComSpec", FilePath, 256) <> 0) And (ShellExecute(Me.hwnd, vbNullString, FilePath, CMD, 0, SW_HIDE) > 32) Then
           Suicide = True
       End If
   End If

End Function

#4
Okay Played a little with the WMI today and i thought lets make something useful and done this little function which retrieves various information from active network adapters, hope you guys can use it have fun with it.

Option Explicit
'---------------------------------------------------------------------------------------
' Function : GetAdapterInfo
' DateTime : 13.07.2010 12:30PM
' Author : Mi4night
' Mail : mi4night@hotmail.com
' Purpose : Retrieve Network Adapter Information through the WMI
' Usage : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
'---------------------------------------------------------------------------------------
Public Function GetAdapterInfo() As Collection
Dim objWMIService As Object
Dim AdapterConfigSet As Object
Dim AdapterConfig As Variant
Dim strComputer As String
Dim NetInfo As String
Dim i As Integer

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set AdapterConfigSet = objWMIService.ExecQuery("Select Caption,DefaultIPGateway,DNSServerSearchOrder,IPAddress,DHCPEnabled,IPSubnet,MACAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
Set GetAdapterInfo = New Collection
For Each AdapterConfig In AdapterConfigSet



For i = LBound(AdapterConfig.IPAddress) To UBound(AdapterConfig.IPAddress)

GetAdapterInfo.Add "Adapter Name :" & AdapterConfig.Caption(i) & vbCrLf & _
"IP Address :" & AdapterConfig.IPAddress(i) & vbCrLf & _
"Subnet Mask :" & AdapterConfig.IPSubnet(i) & vbCrLf & _
"Default Gateway :" & AdapterConfig.DefaultIPGateway(i) & vbCrLf & _
"DNS Server :" & AdapterConfig.DNSServerSearchOrder(i) & vbCrLf & _
"Mac Address :" & AdapterConfig.MACAddress(i) & vbCrLf & _
"DHCP Enabled :" & AdapterConfig.DHCPEnabled(i) & vbCrLf & vbNewLine
Next



Next

Set objWMIService = Nothing
Set AdapterConfigSet = Nothing
End Function
#5
Hello all as i downloaded Firefox today i liked the Glow effect when I hovered over so i thought why not asking if anyone has an example of this for me as i know Leandro is a member of this forum he might have an example of doing it using API as i knew he's good at control designing.
Thanks in advanced for any reply.
#6
Programación Visual Basic / [VB6]mPlayWAV
2 Mayo 2010, 02:57 AM
Bueno aquí un pequeño módulo para agregar sonidos wav a su aplicación selecciona entre el archivo local o jugar de Recursos.
(Google Translator)

Option Explicit
'---------------------------------------------------------------------------------------
' Module      : mPlayWAV
' DateTime    : 20/04/2010  01:58AM
' Author      : Mi4night
' Mail        : mi4night@hotmail.com
'Special Thx  : MSDN
' Purpose     : Play a wav file from Resource or File
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
'---------------------------------------------------------------------------------------

'Used API declaration
Private Declare Function sndPlaySound _
                Lib "winmm.dll" _
                Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
                                       ByVal uFlags As Long) As Long
Private Declare Function PlaySoundData _
                Lib "winmm.dll" _
                Alias "PlaySoundA" (lpData As Any, _
                                    ByVal hModule As Long, _
                                    ByVal dwFlags As Long) As Long

'Enumuration to select the way of playing the file
Public Enum PlayType
    WAVFromRes = 0
    FromFile = 1
End Enum

'Flags used by API
Private Const SND_ASYNC = &H1
Private Const SND_NODEFAULT = &H2
Private Const SND_MEMORY = &H4

'Buffer for the Resource WAV File
Dim ResData() As Byte

Public Function PlayWAVSound(PType As PlayType, _
                             Optional ResID As Integer = 0, _
                             Optional ResType As String = vbNullChar, _
                             Optional WavPath As String = vbNullChar) As Integer
    'Simple error handling
    On Error GoTo errHandle:
   
    Const Flags = SND_MEMORY Or SND_ASYNC Or SND_NODEFAULT
   
    'Are any parameters used ?
    If ResID = 0 And WavPath = "" Then
        Exit Function
       
    Else

        'What king of playing type is selected ?
        Select Case PType

            Case 0
                ResData = LoadResData(ResID, ResType)
                PlayWAVSound = PlaySoundData(ResData(0), 0, Flags)

            Case 1
                PlayWAVSound = sndPlaySound(WavPath, SND_ASYNC Or SND_NODEFAULT)
       
        End Select

    End If

    Exit Function
    'Error handling
errHandle:
    MsgBox "Error Code: " & Err.Number & vbCrLf & "Error Description: " & _
    Err.Description, vbCritical, "Error"

End Function
#7
Programación Visual Basic / [VB6]mFileSize
2 Mayo 2010, 02:54 AM
Bueno esto es sólo una función sencilla de determinar el tamaño de archivo de un archivo.

Option Explicit
'---------------------------------------------------------------------------------------
' Module      : mFileSize
' DateTime    : 25/12/09 02:19
' Author      : Mi4night
' Mail        : mi4night@hotmail.com
' Usage       : At your own risk.
' Purpose     : Get the size of a file
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'---------------------------------------------------------------------------------------
Private Declare Function GetCompressedFileSize _
                Lib "kernel32" _
                Alias "GetCompressedFileSizeA" (ByVal lpFileName As String, _
                                                lpFileSizeHigh As Long) As Long

Public Function GetFileSize(FilePath As String) As String
    'Variable Declaration
    Dim FSize As Double
   
    'Verify that the FilePath is given
    If Len(FilePath) <> 0 Then
       
        'Getting FileSize in bit
        FSize = GetCompressedFileSize(FilePath, ByVal 0&)

        If FSize < "1024" Then
            GetFileSize = FSize & " Bytes"
        ElseIf FSize >= "1024" And FSize < "1048576" Then
            GetFileSize = Round(FSize / 1024, 2) & " KB"
        ElseIf FSize >= "1048576" Then
            GetFileSize = Round(FSize / 1048576, 2) & " MB"
        End If

    Else
        Exit Function
    End If

End Function