set attributes

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Feb 2008
Posts: 25
Reputation: Neji is an unknown quantity at this point 
Solved Threads: 1
Neji's Avatar
Neji Neji is offline Offline
Light Poster

set attributes

 
0
  #1
Apr 5th, 2008
help for this...
want to set an attribute of file.
4 status Hidden, archive, system, read only.

thank you all...

Best Regards

Neji
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: set attributes

 
5
  #2
Apr 5th, 2008
see this following code :
needed 4 check box, 1 textbox and 2 button.
  1. Dim NamaFile As String
  2. Private Sub Command1_Click()
  3. Cmd.Filter = "All Files|*.*"
  4. Cmd.DialogTitle = "Select Target"
  5. Cmd.ShowOpen
  6. NamaFile = Cmd.FileName
  7. Text1.Text = NamaFile
  8. End Sub
  9.  
  10. Private Sub Command2_Click()
  11. Dim NilaiAttributes As Byte
  12. If NamaFile <> "" Then
  13. NilaiAttributes = (Check1.Value * 2) + (Check2.Value * 4) + _
  14. (Check3.Value * 1) + (Check1.Value * 32)
  15. SetAttr NamaFile, NilaiAttributes
  16. MsgBox "Set attributes successfull", vbInformation, "Setting Attributes"
  17. End If
  18. End Sub
  19.  
  20. Private Sub Text1_Change()
  21. NamaFile = Text1.Text
  22. End Sub
  23.  
  24. Private Sub Text1_GotFocus()
  25. NamaFile = Text1.Text
  26. End Sub

Hope this helps...
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 25
Reputation: Neji is an unknown quantity at this point 
Solved Threads: 1
Neji's Avatar
Neji Neji is offline Offline
Light Poster

Re: set attributes

 
0
  #3
Apr 6th, 2008
thank you
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 116
Reputation: november_pooh is an unknown quantity at this point 
Solved Threads: 0
november_pooh november_pooh is offline Offline
Junior Poster

Re: set attributes

 
0
  #4
Apr 8th, 2008
loved to learn this
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1
Reputation: RockyRhodes is an unknown quantity at this point 
Solved Threads: 0
RockyRhodes RockyRhodes is offline Offline
Newbie Poster

Re: set attributes

 
0
  #5
Jul 13th, 2008
I need to do the same thing, only with a folder. But I may be missing something fundamental. With VB6 I get errors on line 3 of the example code. "Object Required". That is the 'cmd.filter =' line.

What am I missing? What object is it looking for?

Thanks
-RR
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC