943,627 Members | Top Members by Rank

Ad:
Apr 5th, 2008
2

set attributes

Expand Post »
help for this...
want to set an attribute of file.
4 status Hidden, archive, system, read only.

thank you all...

Best Regards

Neji
Similar Threads
Reputation Points: 34
Solved Threads: 1
Light Poster
Neji is offline Offline
28 posts
since Feb 2008
Apr 5th, 2008
7

Re: set attributes

see this following code :
needed 4 check box, 1 textbox and 2 button.
vb Syntax (Toggle Plain Text)
  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...
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,138 posts
since Nov 2007
Apr 6th, 2008
0

Re: set attributes

thank you
Reputation Points: 34
Solved Threads: 1
Light Poster
Neji is offline Offline
28 posts
since Feb 2008
Apr 8th, 2008
0

Re: set attributes

loved to learn this
Reputation Points: 29
Solved Threads: 0
Junior Poster
november_pooh is offline Offline
120 posts
since Mar 2008
Jul 13th, 2008
0

Re: set attributes

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RockyRhodes is offline Offline
1 posts
since Jul 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Whats Tabel Using ???
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Stop a program from becoming unresponsive





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC