|
Subject:
|
Access permisison
|
|
Posted By:
|
monika.vasvani
|
Post Date:
|
7/24/2008 4:56:05 AM
|
Hi All
I have one application in Visual Basic.I have created one folder at runtime.I want to give permission to that folder that only administrator can access this folder,nobody can.
Is it possible in visual basic?
Second problem is:I have created runtime excel files.It works perfectly.
But problem is i want set allignment property through coding excel file.
My code is:
Set AppXls = CreateObject("Excel.Application") Set ObjWb = AppXls.Workbooks.Add
Set ObjWs = ObjWb.Worksheets.Add ObjWs.Range("B1").Value = "SISTER NIVEDITA SCHOOL ON WHEELS" ObjWs.Range("B2").Value = "SUPPORTED BY" 'ObjWs.Range("B2").Font.Bold = True ObjWs.Range("B3").Value = "SHARE AND CARE FOUNDATION-U.S.A" ObjWs.Range("B4").Value = "MEDICAL REPORT" ObjWs.Range("C4").Value = Label3.Caption ObjWs.Range("D4").Value = txt_date.Text ObjWs.Range("B7") = Text1(0).Text ObjWs.Range("B8") = cmb_address.Text ObjWs.Range("B9") = Text1(2).Text
what i do?
Pls help me.
Thanks monika
|
|
Reply By:
|
gbianchi
|
Reply Date:
|
7/24/2008 7:47:44 AM
|
Hi there..
Did you try the filesystemobject that's inside the scripting runtime in VB? maybe you can change permissions from there (although I don't remember is that object fits you)...
For the excel part, the easy trick is to save a macro that do what you need (just start saving a macro, do all the alignment you need, then stop the macro). After that, check the code that excel wrote for you, and done.
HTH
Gonzalo
=========================================================== Read this if you want to know how to get a correct reply for your question: http://www.catb.org/~esr/faqs/smart-questions.html ^^Took that from dparsons signature and he Took that from planoie's profile =========================================================== My programs achieved a new certification (can you say the same?): WORKS ON MY MACHINE http://www.codinghorror.com/blog/archives/000818.html =========================================================== I know that CVS was evil, and now i got the proof: http://worsethanfailure.com/Articles/Classics-Week-I-Hate-You.aspx ===========================================================
|
|
Reply By:
|
monika.vasvani
|
Reply Date:
|
7/25/2008 11:53:57 PM
|
Hi all
I have already posted my article for access permission.
But i would like to know how to give password and username to folder which is created at runtime?
is it possible through coding in vb?
If yes pls help me
Thnaks monika
|
|
Reply By:
|
BrianWren
|
Reply Date:
|
7/31/2008 1:08:34 PM
|
The mechanism that Microsoft has for controlling access to resources in the file system (files, folders, etc.) is through the Access Control List (ACL). Though it is pretty easy to use this through Windows Explorer, the means through code is pretty involved.
You have to do things like creating an Access Control Entry object (ACE), adjusting its properties, then adding it to the collection of ACEs that a given resource has. It is a lot of code, but it is absolutely something that can be done through Visual Basic code.
I don’t believe you can set a password on a resource. It is controlled through the person logged onto the machine, and that does involve a password.
I have entered the acronyms involved so that you will have some detail through which to make a web search.
|