forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


URI Decoder

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Jun 07, 2003 1:18 am    Post subject: URI Decoder Reply with quote

Just a little program I made during the beta testing of VDS 5. Use
your own images for the buttons.

-Garrett

Code:
  Option ErrorTrap,ErrorBranch
  Option Decimalsep,.
  Option Fieldsep,|
  Option Scale,96
  Option Sleeptime,100
  %%ProgramName = "URI Decoder"
  %%ProgramVersion = "1.0"
  %%ProgramDate = "10 August, 2002"
  %%FileName = "uridecoder"
  %%URL = "http://www.vdsworld.com/"
  %%Email = "info@youremail.com"
  %%SupportEmail = "support@youremail.com"
  %%CopyYear = "İ 2003,"
  %%Company = "Your Company"
  If @equal(%1,/ER)
    Goto ERRORDIALOG
  End
  If @equal(%1,/A)
    Goto ABOUTBOX
  End
  If @winexists(%%ProgramName)
    Window Activate,%%ProgramName
    Exit
  End

  Inifile Open,@path(%0)%%FileName".ini"
  %T = @iniread(Settings,T)
  %L = @iniread(Settings,L)
  %W = @iniread(Settings,W)
  If @null(%T)
    %T = -1
    %L = 0
    %W = 1
  End

  Title %%ProgramName
  DIALOG CREATE,%%ProgramName,%T,%L,387,264,DRAGDROP
  DIALOG ADD,EDIT,EDIT2,34,0,387,230,,,MULTI,WRAP,SCROLL
  DIALOG ADD,MENU,&File,&About,-,E&xit|CTRL+Q
  DIALOG ADD,MENU,&Edit,&Copy|CTRL+C,&Paste|CTRL+V
  DIALOG ADD,PROGRESS,PROGRESS1,0,0,400,2,0
  DIALOG ADD,BITBTN,BITBTN0,6,4,24,24,#OPEN.BMP,,Select a URI encoded file
  DIALOG ADD,BITBTN,BITBTN1,6,28,24,24,#ERASE3.BMP,,Clear output
  DIALOG ADD,BITBTN,BITBTN2,6,52,24,24,#PASTE.BMP,,Convert encoded data from clipboard
  DIALOG ADD,BITBTN,BITBTN3,6,76,24,24,#COPY.BMP,,Copy
  DIALOG SHOW
  HOTKEY ADD,HOT1,CTRL+V
  HOTKEY ADD,HOT2,CTRL+C
  HOTKEY ADD,HOT3,DEL
  %%ActiveStatus = On
  %%Input =

:EventLoop
  Wait Event,0
  %E = @event()
  If %E
    Goto %E
  End
  Goto EventLoop

:ExitMENU
:CLOSE
  Inifile Open,@path(%0)%%FileName".ini"
  Inifile Write,Settings,T,@winpos(%%ProgramName,T)
  Inifile Write,Settings,L,@winpos(%%ProgramName,L)
  Exit

:Timer
  If @equal(%%ActiveStatus,On)
    If @not(@equal(@winactive(N),%%ProgramName))
      HOTKEY REMOVE,HOT1
      HOTKEY REMOVE,HOT2
      HOTKEY REMOVE,HOT3
      %%ActiveStatus = Off
    End
  End
  If @equal(%%ActiveStatus,Off)
    If @equal(@winactive(N),%%ProgramName)
      HOTKEY ADD,HOT1,CTRL+V
      HOTKEY ADD,HOT2,CTRL+C
      HOTKEY ADD,HOT3,DEL
      %%ActiveStatus = On
    End
  End
  Goto EventLoop

:HOTKEY
  %%HotKey = @HOTKEY()
  If %%HotKey
    If @equal(%%HotKey,HOT1)
      %%URIdata = @clipbrd()
      Gosub URIconvert
      Dialog Set,Edit2,%%URIdata
    End
    If @equal(%%HotKey,HOT2)
      Clipboard Set,@dlgtext(Edit2)
    End
    If @equal(%%HotKey,HOT3)
      Dialog Set,Edit2,
    End
  End
  Goto EventLoop

:DRAGDROP
  List Create,1
  List Dropfiles,1
  %F = @item(1,0)
  List Clear,1
  List Close,1
  Goto OPENFILE

:BITBTN0BUTTON
  %F = @filedlg("All files (*.*)|*.*",Open file)
  if @null(%F)
    goto evloop
  end
:OPENFILE
  List Create,1
  List Loadfile,1,%F
  %%URIdata = @text(1)
  List Clear,1
  List Close,1
  Gosub URIconvert
  Dialog Set,Edit2,%%URIdata
  Goto EventLoop

:BITBTN1BUTTON
  Dialog Set,Edit2,
  Goto EventLoop

:PasteMENU
:BITBTN2BUTTON
rem -- Paste into input box
  %%URIdata = @clipbrd()
  Gosub URIconvert
  Dialog Set,Edit2,%%URIdata
  Goto EventLoop

:CopyMENU
:BITBTN3BUTTON
rem -- Copy output box
  %E = @sendmsg(~EDIT2,$0301,0,0)
  Goto EventLoop


:URIconvert
  repeat
    if @not(@zero(@pos("+",%%URIdata)))
      %%URIdata = @strins(%%URIdata,@pos("+",%%URIdata)," ")
      %%URIdata = @strdel(%%URIdata,@pos("+",%%URIdata),@pos("+",%%URIdata))
    end
  until @zero(@pos("+",%%URIdata))
  %%LastPos = 1
  repeat
    if @not(@zero(@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata)))))
      if @equal(@substr(@substr(%%URIdata,%%LastPos,@len(%%URIdata)),@succ(@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata)))),@sum(@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata))),2)),25)
        %%LastPos = @sum(%%LastPos,@pos("%25",@substr(%%URIdata,%%LastPos,@len(%%URIdata))))
      else
        %%URIdata = @strins(%%URIdata,@pred(@sum(%%LastPos,@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata))))),@chr($@substr(@substr(%%URIdata,%%LastPos,@len(%%URIdata)),@succ(@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata)))),@sum(@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata))),2))))
        %%URIdata = @strdel(%%URIdata, @pred(@sum(%%LastPos,@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata))))), @sum(@sum(%%LastPos,@pos("%",@substr(%%URIdata,%%LastPos,@len(%%URIdata)))),1))
      end
    end
  until @zero(@pos("%", @substr(%%URIdata,%%LastPos,@len(%%URIdata)) ))
  repeat
    if @not(@zero(@pos("%25",%%URIdata)))
      %%URIdata = @strins(%%URIdata,@pos("%25",%%URIdata),"%")
      %%URIdata = @strdel(%%URIdata,@pos("%25",%%URIdata),@sum(@pos("%25",%%URIdata),2))
    end
  until @zero(@pos("%25",%%URIdata))
  exit

REM   .:::::::::::|ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ|:::::::::::.
REM  :::::::::::::| ABOUT BOX WINDOW                 |:::::::::::::
REM   ·:::::::::::|__________________________________|:::::::::::·

:AboutMENU
  Run @shortname(%0) /A
  Goto Eventloop

:ABOUTBOX
  If @winexists(About %%ProgramName)
    Window Activate,%%ProgramName
    Exit
    Stop
  End
  DIALOG CREATE,About %%ProgramName,-1,0,450,413,ONTOP,NOSYS
  DIALOG ADD,STYLE,ASTYLE7,Verdana,8,,,
  DIALOG ADD,STYLE,ASTYLE6,Verdana,16,BI,,NAVY
  DIALOG ADD,STYLE,ASTYLE4,Verdana,8,,,
  DIALOG ADD,STYLE,ASTYLE3,Verdana,8,,WHITE,BLACK
  DIALOG ADD,STYLE,ASTYLE2,Verdana,8,B,WHITE,BLACK
  DIALOG ADD,STYLE,ASTYLE1,,,,WHITE,WHITE
  DIALOG ADD,TEXT,AHEADERBACK,0,0,450,78,,,ASTYLE1
  DIALOG ADD,PROGRESS,AHEADERLINE,78,0,450,2,0
  DIALOG ADD,TEXT,AHEADERTITLE,16,16,,,Information About %%ProgramName,,ASTYLE2
  DIALOG ADD,TEXT,AHEADERTEXT,38,30,340,30,Who made it?  What version is it?  When was it updated?  And information that you probably didn't want know.,,ASTYLE3
  DIALOG ADD,BITMAP,ABITMAP2,10,390,48,48,#info.bmp
  DIALOG ADD,BUTTON,ABUTTON3,380,10,65,24,Ok,Close About Box,DEFAULT
  DIALOG ADD,TEXT,ATEXT1,96,62,,,%%ProgramName,,ASTYLE6
  DIALOG ADD,BITMAP,ABITMAP1,92,10,32,32,%0
  DIALOG ADD,TEXT,ATEXT2,130,62,,,Version:@tab()%%ProgramVersion,,ASTYLE4
  DIALOG ADD,TEXT,ATEXT3,150,62,,,Dated:@tab()@tab()%%ProgramDate,,ASTYLE4
  DIALOG ADD,TEXT,ATEXT5,170,62,,,Copyright:@tab()%%CopyYear %%Company,,ASTYLE4
  DIALOG ADD,TEXT,ATEXT6,190,62,,,Email:@tab()@tab()%%Email,Click to open email,ASTYLE4,CLICK,HAND
  DIALOG ADD,TEXT,ATEXT7,210,62,,,Web:@tab()@tab()%%URL,Click to visit,ASTYLE4,CLICK,HAND
  DIALOG ADD,TEXT,ATEXT4,230,62,,,Licensed to:@tab()%%RegdUser,,ASTYLE4
  DIALOG ADD,TEXT,ATEXT9,250,62,,,Credits:,,ASTYLE4
  DIALOG ADD,EDIT,AEDIT1,270,62,374,100,EDIT1,,MULTI,SCROLL,WRAP,READONLY,ASTYLE7
  DIALOG SHOW
  List Create,1
  List Add,1,"Garrett R. Hylltun - for:"
  List Add,1,"     Concept, Core Programming, Alpha Testing"
  List Add,1,"     Beta Testing"
  DIALOG SET,AEDIT1,@text(1)
  List Clear,1
  List Close,1
  DIALOG SHOW

:aEventloop
  WAIT EVENT
  %E = @event()
  If %E
    Goto %E
  End
  Goto aEventLoop

:ATEXT6CLICK
  Shell Open,"mailto:"%%Email"?Subject=About "%%ProgramName
  Goto aEventloop

:ATEXT7CLICK
  Shell Open,%%URL
  Goto aEventloop

:ABUTTON3BUTTON
  Exit
  Stop
  Goto aEventloop

REM   .:::::::::::|ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ|:::::::::::.
REM  :::::::::::::| ERROR BRANCH                     |:::::::::::::
REM   ·:::::::::::|__________________________________|:::::::::::·

:ErrorBranch
  RUN @shortname(%0)" /ER "@error(E)" "@error(N)" "%E
  STOP

  :ERRORDIALOG
    DIALOG CREATE,%%ProgramName Error,-1,0,450,293,NOSYS,ONTOP
    DIALOG ADD,STYLE,ERSTYLE4,Verdana,8,,,
    DIALOG ADD,STYLE,ERSTYLE3,Verdana,8,,WHITE,BLACK
    DIALOG ADD,STYLE,ERSTYLE2,Verdana,8,B,WHITE,BLACK
    DIALOG ADD,STYLE,ERSTYLE1,,,,WHITE,WHITE
    DIALOG ADD,TEXT,ERHEADERBACK,0,0,450,78,,,ERSTYLE1
    DIALOG ADD,PROGRESS,ERHEADERLINE,78,0,450,2,0
    DIALOG ADD,TEXT,ERHEADERTITLE,16,16,,,Program error notice,,ERSTYLE2
    DIALOG ADD,TEXT,ERHEADERTEXT,38,30,340,30,"The program encountered an error and is providing information you can send to the support department",,ERSTYLE3
    DIALOG ADD,BITMAP,ERBITMAP1,10,390,48,48,#error.bmp
    DIALOG ADD,TEXT,ERTEXT1,90,10,420,44,"In the edit box below there is some information regarding the error that has occured in the program.  If you wish, you may send this information to the support department"
    DIALOG ADD,EDIT,EREDIT1,150,10,420,98,,,MULTI,SCROLL,WRAP,ERSTYLE4
    DIALOG ADD,BUTTON,ERBUTTON4,260,10,65,24,Ok,,DEFAULT
    DIALOG SHOW
    LIST CREATE,1
    LIST Add,1,"Copy the following information and email it to the support department at:  "%%SupportEmail
    LIST Add,1,
    LIST Add,1,"Program Name:"@tab()%%ProgramName
    LIST Add,1,"Program Version:"@tab()%%ProgramVersion
    LIST Add,1,"Program Date:"@tab()%%ProgramDate
    LIST Add,1,"Error Code:"@tab()%2
    LIST Add,1,"Line Number:"@tab()%3
    LIST Add,1,"Event Status:"@tab()%4
    If @equal(@null(@regread(LOCAL,SOFTWARE\Microsoft\Windows NT\CurrentVersion,CurrentVersion)))
      LIST ADD,1,"OS Name:"@tab()@regread(LOCAL,SOFTWARE\Microsoft\Windows NT\CurrentVersion,ProductName)
      LIST ADD,1,"OS Version:"@tab()@regread(LOCAL,SOFTWARE\Microsoft\Windows NT\CurrentVersion,CurrentVersion)
      LIST ADD,1,"OS Build:"@tab()@regread(LOCAL,SOFTWARE\Microsoft\Windows NT\CurrentVersion,CurrentBuildNumber)
    Else
      LIST ADD,1,"OS Version:"@tab()@regread(LOCAL,Software\Microsoft\Windows\CurrentVersion,Version)
      LIST ADD,1,"OS Ver Num:"@tab()@regread(LOCAL,Software\Microsoft\Windows\CurrentVersion,VersionNumber)
    End
    LIST Add,1,"Free memory"@tab()@SYSINFO(FREEMEM)" Kb"
    LIST Add,1,"HD Free (c:\):"@tab()@volinfo(C,F)" Kb"
    DIALOG SET,EREDIT1,@text(1)
    LIST CLEAR,1
    LIST CLOSE,1
    FILE DELETE,@path(%0)error.dat
    WAIT EVENT
    EXIT
    STOP

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
ïż½ Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
ïż½ http://www.freewarehome.com <-- Freeware listings since 1996
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Jun 07, 2003 11:31 am    Post subject: Reply with quote

Cool. Now all I have to do is get VDS 5. Wink
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 622
Location: Indiana

PostPosted: Sun Mar 28, 2004 8:01 pm    Post subject: Reply with quote

I feel like a newbie still Embarassed , what does a URL decoder do Confused
Confused
Back to top
View user's profile Send private message Visit poster's website AIM Address
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Mar 28, 2004 9:32 pm    Post subject: Reply with quote

It will decode URLs when they are obfuscated like this Smile :
http%3A%2F%2Fwww.vdsworld.com

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 622
Location: Indiana

PostPosted: Mon Mar 29, 2004 3:38 am    Post subject: Reply with quote

Cool
I took out all the BMPs and it seems to work good.. I used your example FreezingFire, and it filtered it to:
www.vdsworld.com

Smile
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group