|
hello frnds,
i can share a folder using VB.Net, but can i add a groups/User to shareing ????
if any one have code then please tell me.....
any helpful link...???
thankx in advance.
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
You will need the following Imports statements in your class:
Imports System.Security.AccessControl
Imports System.IO
Imports System.Reflection
Then, the following code would add the "Users" Group to the Sharing on the Folder containing your Application. For other folders just set the appropriate value for the Location variable and set the user variable to the group or user you wish to add.
However, a cautionary note. You will need Local Admin rights to run this code.
Try
Dim user As String = "Users"
Dim location as String = Path.GetDirectoryName(Assembly.GetExecutingAssembly.Location)
Dim rule As FileSystemAccessRule
rule = New FileSystemAccessRule(user, _
FileSystemRights.FullControl, _
InheritanceFlags.None, _
PropagationFlags.NoPropagateInherit, _
AccessControlType.Allow)
Dim security As DirectorySecurity = Directory.GetAccessControl(location)
Dim modified as Boolean = false
security.ModifyAccessRule(AccessControlModification.Set, rule, modified)
rule = New FileSystemAccessRule(user, _
FileSystemRights.FullControl, _
InheritanceFlags.ContainerInherit OR InheritanceFlags.ObjectInherit, _
PropagationFlags.InheritOnly, _
AccessControlType.Allow)
modified = false
security.ModifyAccessRule(AccessControlModification.Add, rule, modified)
Directory.SetAccessControl(location, security)
Catch ex As Exception
End Try
I used this in a Custom Installer Action, but now I have changed to using WIX to write my installers, which has custom actions to set folder security built in.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
hey, thankx many for your great help
but hwo can i use this code ???
means where should i give the folder name to which i am going to add the group
please help....
thankx once again
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
I wana make an application that should recognise voice and start the appropriate exe file (programe). How can i do this? I m a beginner in voice recognition. Don't know what to do? Have collected material on SAPI 5.1. Any code example ??? for novice? or material to read?
|
|
|
|
|
Voice recognition is a huge topic. There's a Microsoft SDK, is it SAPI ? either way, those docs are your best bet for more info.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i have a program which is to un at the client end. currently what i am doing is installing the .net framework an then installing the application.Is there any way to integrate the .net framework with the application so that there does not occur any need to install the .net framework manually.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
No - best you can do is an MSI which knows to download and install .NET seperately, or a C++ installer that runs the .NET installer, then runs your MSI
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, I developed an application that will display an information on the form. But the information that I prefer to display contain a merge cell like we done in Microsoft Excel. Currently I design in a list view but I feel that list view could not allow me to do a merge cell. I'm using VB 2005. Could anyone suggest me which control should i use on the form to display an information with a merge cell ability?
|
|
|
|
|
Roath Kanel wrote: Currently I design in a list view but I feel that list view could not allow me to do a merge cell.
No, it doesn't.
There is currently no standard control in the toolbox that will let you do this with minial effeort. You'd have to find a third party Grid or DataGrid control that supports this (I don't know of any) if you want it to just be "drop in and play".
THe only other option you have to to take an existing control and add this support to, say, the DataGridView control, and supply your own custom rendering code to draw the cells merged together. You would also have to add properties to a Cell class, or whatever class your parent control uses, to support telling your rendering code who to draw the cells.
|
|
|
|
|
Thank you very much for your reply. I will try check DataGridView control.
|
|
|
|
|
I was wondering if its possible to set the visibility element of an HTML table, using the aspx.vb file. I know you cant set the ID and call it like that. Just wondering if there is any good way to do this (preferably without JS). What i'm doing is setting certain tables to be visible based on who logs in.
Thanks,
Nate Lindley
|
|
|
|
|
This is a question for the ASP.NET forum. It really has nothing to do with VB.NET or C#.
|
|
|
|
|
And here I thought I just caught a cross-poster I could flame!
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Whoa there! Take a deep breath, put down the flame thrower and take two steps back.
|
|
|
|
|
Easy, easy now
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have a DataSet which has Two tables: TableAll, TableQueried
TabelAll has all data available.
What I want is to use a command to select only those rows in TableAll and copy them to TabelQueried which are LIKE some pattern.
I knew how to do this when I had a database and used connections; but now there is no database.
How should I do anything like this command:
"SElECT * FROM TABELALL WHERE Data LIKE " & Pattern
|
|
|
|
|
You could just use a 'For each row' in TableAll, and then check the existing condition that you're looking for (the like) and then when the row meets the condition insert 'row' into TableQueried.
Nate Lindley
|
|
|
|
|
Thank you for your answer, but in fact this is what I am doing right now!
But as a matter of fact, my Table is very huge and I have to do the search many times. If I make a search on all rows for every search, it would be slow.
I am looking for faster methods, if any...
|
|
|
|
|
Why do you want to dump the results into a new table? Why not just fill the original table with a dataset query based on your search option?
|
|
|
|
|
If you're using VS 2005, you could also use the ToTable method of the System.Data.DataView class.
|
|
|
|
|
Thank you, I will give it a try...
|
|
|
|
|
Oh This didn't cover what I needed!
Thanks anyway!
|
|
|
|
|
I am trying to cancel the mouse wheel scrolling in a combobox and I noticed that there is a Combobox.MouseWheel event but that just relays information it doesnt allow me to cancel the event.
This is the only thing I have found with some type of definite answer[^] and it looks like something that I dont want to do unless I have to.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
That's the only way you're going to be able to do it. You have to intercept the Scroll Wheel messages before they get processed by the controls WndProc.
|
|
|
|
|
Here's what Im trying and it doesnt pick up the scrolling while focused on the combobox only if I scroll with the mousewheel while focused anywhere else does it work.
Private Const WM_MOUSEWHEEL As Integer = &H20A<br />
<br />
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)<br />
Select Case m.Msg<br />
Case WM_MOUSEWHEEL<br />
Select Case True<br />
Exit Sub<br />
End Select<br />
MyBase.WndProc(m)<br />
End Sub
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|