Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 135,982 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,221 people online right now. Registration is fast and FREE... Join Now!




Integrating & StrInput into Directory.

 
Reply to this topicStart new topic

Integrating & StrInput into Directory.

AntiBNI
31 Aug, 2007 - 01:57 PM
Post #1

D.I.C Head
**

Joined: 21 Jul, 2006
Posts: 59


My Contributions
How can i integrate StrInput in the directory as the username.

i have tried every option...

Something like this:
Kill "C:\Documents and Settings\& StrInput &\Local Settings\Temporary Internet Files\*.*"

Heres the whole Project so u have a better understanding of what im triying to do.


CODE

Public Property Get UserName() As String

End Property
Private Sub Exit_Click()
End
End Sub

Private Sub Form_Load()
Dim StrInput As String
StrInput = InputBox("Enter Computers Username")
If StrPtr(StrInput) Then
Text1.Text = StrInput
Else
MsgBox ("Are you sure?")
End
End If
End Sub

Private Sub Internet_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Internet_cli.Visible = True
Frame_Delete.Visible = True
Cookies.Visible = True
Temp_Int.Visible = True
End Sub

Private Sub Image3_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Image4.Visible = True
End
End Sub
Private Sub Prefetch_Click()
Delete.Visible = True
Kill "C:\WINDOWS\Prefetch\*.*"
Delete.Visible = False
End Sub
Private Sub Temp_Int_Click()
Kill "C:\Documents and Settings\" & StrInput & "\Local Settings\Temporary Internet Files\*.*"
End Sub


Help will be greatly appriciated biggrin.gif

This post has been edited by AntiBNI: 31 Aug, 2007 - 01:58 PM
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Integrating & StrInput Into Directory.
31 Aug, 2007 - 05:38 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8525
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
For starters you need to get this out of the Form_Load event

CODE

Dim StrInput As String
StrInput = InputBox("Enter Computers Username")


The only place StrInput will be visible is in the Form_Load as thats where it was created. This needs to be global so the whole code can see and use it. Once you've done that, can create a string variable like so

CODE

Dim whatToKill =  "C:\Documents and Settings\" & StrInput & "\Local Settings\Temporary Internet Files\*.*"


Then do your normal work from there

CODE

Private Sub Temp_Int_Click()
      Dim whatToKill =  "C:\Documents and Settings\" & StrInput & "\Local Settings\Temporary Internet Files\*.*"
      Kill whatToKill
End Sub


You also might want to put a message box somewhere in there to ensure the whatToKill is getting the value you're hoping for

CODE

Private Sub Temp_Int_Click()
      Dim whatToKill =  "C:\Documents and Settings\" & StrInput & "\Local Settings\Temporary Internet Files\*.*"
      MsgBox(whatToKill)
      Kill whatToKill
End Sub


Hope this helps smile.gif

Happy Coding!
User is offlineProfile CardPM
+Quote Post

AntiBNI
RE: Integrating & StrInput Into Directory.
31 Aug, 2007 - 08:07 PM
Post #3

D.I.C Head
**

Joined: 21 Jul, 2006
Posts: 59


My Contributions
lol,sorry for being such a noob but im geting " Invalid outside procedure" >_<

Heres the code:


CODE

Dim Strinput As String
Strinput = InputBox("Enter Computers Username") <--- im getting the error here,i don't know how to make it public.

Private Sub Exit_Click()
End
End Sub

Private Sub Form_Load()
Dim Strinput As String
Strinput = InputBox("Enter Computers Username")
If StrPtr(Strinput) Then
Text1.Text = Strinput
Else
MsgBox ("Are you sure?")
End
End If
End Sub

Private Sub Internet_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Internet_cli.Visible = True
Frame_Delete.Visible = True
Cookies.Visible = True
Temp_Int.Visible = True
End Sub

Private Sub Image3_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Image4.Visible = True
End
End Sub
Private Sub Prefetch_Click()
Delete.Visible = True
Kill "C:\WINDOWS\Prefetch\*.*"
Delete.Visible = False
End Sub
Private Sub Temp_Int_Click()
      Dim TempInternetFiles = "C:\Documents and Settings\" & StrInput & "\Local Settings\Temporary Internet Files\*.*"
      MsgBox (TempInternetFiles)
      Kill TempInternetFiles
End Sub


Thanks for borrowing some of ur time
It is appriciated.



User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Integrating & StrInput Into Directory.
31 Aug, 2007 - 08:25 PM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8525
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Declaring the variable needs to be global

CODE

Dim Strinput As String


But you cannot set it like this outside of a function or sub procedure. So move this line Strinput = InputBox("Enter Computers Username") inside the Form_Load Event.
User is offlineProfile CardPM
+Quote Post

AntiBNI
RE: Integrating & StrInput Into Directory.
31 Aug, 2007 - 08:57 PM
Post #5

D.I.C Head
**

Joined: 21 Jul, 2006
Posts: 59


My Contributions
Thanks bro,it worked anime1.gif icon_up.gif
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Integrating & StrInput Into Directory.
31 Aug, 2007 - 09:03 PM
Post #6

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8525
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
No problem, glad I could help smile.gif

Happy Coding!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 10:49AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month