Implement Custom User-roles In Windows Application
Apr 21, 2010
I am looking for ways to implement custom user-roles in windows application with vb.net. I got a database table called Roles with Administrator and User entries. User cannot see some of the form data. In ASP.NET MVC we can do like.
[Authorize(Roles = "Administrator")]
public function GetAccount() as Array
End Function
View 1 Replies
ADVERTISEMENT
Jan 15, 2010
I am creating a website using asp.net mvc model. When you create an mvc application asp.net automatically creates roles/profiles for user and admins (as far as i know) and corresponding tables in sql server database.I a need a new profile/role names "sponsor" that has all the benefits of users/admins (like authorization etc).
View 1 Replies
Sep 2, 2009
I have a winforms (VB 2008) based app that I'm developing and I want to use custom roles for user access.Application Layout:I have a Main form that opens a login form when certain actions occur.The Login form intern uses an authentication class that I've created, to authenticate users and set access rights.On my Applications settings page, I have Authentication Mode set to Application-defined because I cannot use Windows Authentication in the environment where this will be deployed.
The application uses a MS SQL 2005 db and the 3 tables I'm using in the authentication process are the User_Account , User_Roles and User_Access tables. The combination of an account in the User_Account and the roles within the User_Roles table are the bases for the User_Access table. Using the User_Access table is how I assign access to the various functions within the application
Authentication Method:To authenticate a user, I'm using the "My.User.CurrentPrincipal" (Code below) method. The My.User object works great and allows the use of "My.User.Name" property throughout the app when referring to the currently authenticated user.
Access Method:In order to set the current users access levels I'm using a function within my Authentication class and passing in My.User.Name as a variable. The function uses a Dataset Table Adaptor and a Select Case statement inside a For loop to assign all the access levels for the user (Function code below).
My Problem:This method of assigning access rights to a user does work but it's not persistent throughout the application as the My.User object is.I would like to find a way to create custom roles through the My.User object using its .IsInRole property. I would like to have these roles dynamically created using my User_Roles table.This would allow the custom roles to be used throughout my application using the My.User.IsInRole ("MyRole")syntax ...similar to how I'm currently able to use My.User.Name.Unfortunately the only roles I can currently validate against are the built in Windows
type accounts (Adminisrator ...ect.).
'User Authentication example:
If Authenticate.CheckPassword(tbxUserName.Text, strPassword) Then
My.User.CurrentPrincipal = New GenericPrincipal(New GenericIdentity(tbxUserName.Text), Nothing)[code].....
View 1 Replies
Nov 22, 2010
Is it possible to use membership roles using sql provider in windows forms application
View 1 Replies
Feb 20, 2012
I was wondering how to implement a custom character set for use by an application, i.e. hex bytes that are read by the program then converted and displayed in the window. If this requires first converting the bytes in a file to an already implemented character set, I'm cool with it - I'll go with whatever works or works best. I'm writing with VB.NET 2010, and running Windows 7 Home Premium x64, by the way.
View 2 Replies
Feb 15, 2011
I'm developing a "small" warehouse-management WebApplication for few users(5-10 parralel) but with a complex authorization system(checking if pages,menus,TabPanels, UserControls and even single controls are visible or enabled) and permanent and frequent access. Because i've only limited experiences with the ASP.Net MembershipProvider, i'm unsure what's the best approach for following goal:
I want to hold all users, roles and frequently used masterdata in the Cache(in a Dataset). Hence every readonly access should be faster and causes less traffic than always using the database. On updates,deletes and inserts i would update the cached dataset and also the database.
Can i use or extend the SqlMembershipProvider to achieve this goal and if possible how?
View 1 Replies
May 11, 2009
I want to add Ruler line to my application..how can i achieve this..
View 6 Replies
Jun 21, 2010
Is there a method for checking which roles a user has in SQL using SMO? I can add a role via: user.AddToRole("Administrators") But cannot see an obvious method to progmatically list them.
View 2 Replies
May 11, 2009
I am Developing one designing tool..in this i have to implement Bring to front and sent to back properties.
View 3 Replies
Jan 22, 2011
How to add user to roles during CreateUserWizard.CreatedUser?What's wrong in this code:
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As EventArgs) Handles CreateUserWizard1.CreatedUser
Dim username As TextBox =
[code]....
View 1 Replies
Jul 21, 2006
With VB.net, I'm coding a simple application to get more used to the new .Net format.
I'd like to save all the information to a 'new' database file. how to create a database on the fly, once that is done i'll be able to connect to it no problem, but actually creating the file is proving difficult to work/find out.
Also, with vb.net and the newly created custom file, how can it be made to automatically open that information with the program?
Is there a method in installation to associate the file type with the new program? How can i check when the program loads if a database file has been 'double-clicked' (rather than just running from the .exe of the program) and proceed to load the data?
EDIT1 - Extra InfoThe windows application has many different fields and content etc, then i need to save that to a file that could later be loaded by 'double clicking'. I assumed the easiest way would be to create a mini-database for each unique file
View 3 Replies
Dec 7, 2011
I am wanting to update our current windows forms security to something a lot more flexible. At the moment we have a single column in thew users table which is named 'Access_Level', this field holds an int value (1 to 4) which is then use to determine users access to certain areas of the application. This worked fine when the system was small, but the system is growing rapidly now so I think it is a good time to update the user access and possibly introduce roles.
[Code]...
View 1 Replies
May 17, 2010
I created a custom user control named "XYZ" and It is avaialble at the toolbox menu in the design mode and I can drag and drop it to a vb.net Windows form. What I really want is to dynamically to add this user control to the Windows form during the Windows form load event. Actually I want to add this user control to a "split container" named "sc_1" on the tab page named "tp_1" on a tab control named "tc_1" on a Windows form. What is teh vb code to add a user control to a Windows form. I am using vs 2005 and dotnetwork v2.0.
View 3 Replies
May 30, 2012
I am trying to restrict access to an intranet site via Windows authentication. I would like to control access via active directory user groups, but my added AD groups don't appear to be recognised by .net. I started with the following test code in my app to determine if the group could be used...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Label1.Text = User.Identity.Name
[Code]...
The isuserinrole returns false and the group is not shown in getrolesforuser. However, getrolesforuser returns all of the built in windows groups as well as custom admin user groups created by our anti virus software (SOPHOS). This tells me that .net doesn't seem to have any issue with reading our active directory but I don't understand why my custom group is not being recognised.
View 1 Replies
Mar 30, 2009
I am trying to figure out how to generate code from user input. In Visual Studio 2008, Visual Basic.My script always begins with:function Init (Quest)Then from here a user would input a quest name, type and zone in a interface using windows forms.[code]I would also like to have these available on the UI but wont generate unless a user checks a box to add them or there is a box already for them but wont step into the code unless the user enters something into the box.Is there anyone that can explain how I would go about doing this. Or maybe some kind of visual studio plugin that will help me out.
View 2 Replies
Mar 30, 2009
How to generate code from user input. In Visual Studio 2008, Visual Basic. My script always begins with:
Code:
function Init(Quest)
Then from here a user would input a quest name, type and zone in a interface using windows forms.
Ex:
Code:
RegisterQuest(Quest, "Kill Zombies", "Heritage", "Firestorm")
end
This part a user would enter in his interface what would an NPC say if accepted.
[Code] .....
What I need is a few text boxs that a user can input "Kill Zombies" or whatever they like and when they push a generate button it will create a file with a .quest extension. All of the code remains the same except for the quotes that would be the user input from the interface. Basically everything in quotes can be changed by the user in an interface. I have created my own functions for when a user accepts, deny and complete a quest. The user just needs to input what should happen then click a generate button to throw it all together as a .quest file to be saved in his or her quest folder for the server to call on later.
I also have many other functions like:
AddQuestRewardFaction --- (Quest, Faction ID, Amount)
AddQuestRewardCoin --- (Quest, Copper, Silver, Gold, Plat)
AddQuestStepObtainItem --- (Quest, Step ID, Description, Quantity, Percentage, TaskGroupText, Item ID(s))
Etc
I would also like to have these available on the UI but wont generate unless a user checks a box to add them or there is a box already for them but wont step into the code unless the user enters something into the box.
View 4 Replies
Nov 4, 2009
I am creating a Windows application (WPF) that is going to be running in few stations accessing 1 database.
I already implemented a login form with a login system thru My.User.CurrentPrincipal.Now, I want to implement a "Remember me on this computer" check box in the login form, where should I store the value?
Should it be a cookie? a .settings value? or what good other suggestion do you have.Update Also what data (i.e. what value) shoud I store, I want it to be secure, that users should not be able to copy the values etc.
View 1 Replies
Nov 14, 2011
I've search the net in order to create a custom control but nothing I find is worth looking at, The main thing I want to do is create a skinengin via DLL and import it in my vb 2010 then using or creating some sort of skin builder where I can create a full setting file which contains all the details of the customization regarding the Form(Look, Feel and the controls such as a menu), I have used Iriskin and multiple apps doing this for me and when a user installs my application they still recieve a message about buying the registered DLL file, I would like to create it completely from scratch.
View 2 Replies
May 3, 2011
I'm trying to match up a specific group name and see if it exists for the currently logged in user using Active Directory roles. If the Group Name exists for the Current User, I want that group name to be displayed in a drop down list. Example: If current user is in BIG Group, display BIG in drop down list.Problem: All I am getting is SIDs and I'm not able to get anything to match up to the group name and nothing will show up in the drop down list.I also get the following Error:Error: Object variable or WIth block variable not set.How do I fix this?? here is the code I am using:
Private Sub GetMarketingCompanies()
' code to populate marketing company drop down list based on the current logged in users active directory group that
[code].....
View 3 Replies
Feb 9, 2010
I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an encrypted password format), and a SqlRoleProvider. I need to know if it's possible to administer the users (create new users, assign them to roles, etc.) from a windows application - the powers that be don't want any administrative functionality in the web app itself.Here is the membership provider definition from web.config:
<membership defaultProvider="MyProvider">
<providers>
<add name="MyProvider"
[code].....
View 3 Replies
May 15, 2009
I created my user control for email validation in windows application(C# language).I am using it in the form, if the user leave that textbox it ll show message "E-Mail expected",if its correct value, then it ll be stored in another textbox. How can i retrieve values from the user control into textbox.
View 4 Replies
Sep 8, 2011
I have a requirement for a timer that has the following behaviour:
Millisecond accuracy I want the tick event handler to only be called once the current tick handler has completed (much like the winforms timer)I want exceptions on the main UI thread not to be swallowed up by the thread timer so this requires Invoke/Send instead of BeginInvoke/PostI've played around with CreateTimerQueueTimer and had some success but at the same time had problems with code reentrance and/or locks when deleting the timer.
I decided to create my own timer so that I could get a better idea of what is going on under the hood so that I can fix the locking and reentrance problems. My code seems to work fine leading me to believe that I may as well use it. Does it look sound? I've put in a check if the timer is deleted to make sure that the deletion is complete before the timer can be created again. Does that look ok?
Note: I should say that I call timeBeginPeriod(1) and timeEndPeriod(1) inorder to achieve the millisecond accuracy.(The following code is converted from vb.net to c#, so apologies for any missed mess-ups}
ETA: I've found a problem with it. If the timer is running at an interval of 1 millisecond, and I call, say, Change(300), it locks up @ while (this.DeleteRequest). This must be because the TimerLoop is in the this.CallbackDelegate.Invoke(null) call.
[Code]...
View 1 Replies
Jul 19, 2011
Here are my interface and it's implementation class file. While implenting service function there is a chance to get 3 exceptions.
I need to handle these using a custom fault contract. how to implement 3 exceptions under one fault contract.
Interface:
Function GetEntities() As String
Class file that use the service Interface:
Public Function GetEntities() As String
[Code].....
View 1 Replies
May 9, 2012
With String.Format() it is possible to format for example DateTime objects in many different ways. Every time I am looking for a desired format I need to search around on Internet. Almost always I find an example I can use. For example:
String.Format("{0:MM/dd/yyyy}", DateTime.Now); // "09/05/2012"
But I don't have any clue how it works and which classes support these 'magic' additional strings.So my questions are:How does String.Format map the additional information MM/dd/yyyy to a string result?Do all Microsoft objects support this feature?Is this documented somewhere?Is it possible to do something like this:String.Format("{0:MyCustomFormat}", new MyOwnClass())
View 7 Replies
Sep 30, 2009
I have been developing in VB.net for a cople of years now. I really miss the increment and decrement operators for integers that I grew attached to while using Java and C#. I have seen posts explaining how to implement a custom operator for a class that I have written, but I have not seen any examples of how to do it for a basic type like Integer.[code]....
View 1 Replies
Nov 2, 2008
How do you cache user session in a windows forms application? So that the user session expires when inactive for a certain period of time. I wish to include that functionality using an integrated security and caching application block from microsoft's patterns and practices.
View 2 Replies
Apr 13, 2010
I only managed make the form always on top. But what I want is when the form is on top, user cannot access the other application in the windows.
For example : Some messagebox won't let users access the other application until the users hit the OK button.
View 1 Replies
May 5, 2011
I have an intranet asp.net application and when a page is loaded, i want to log the IP Address, Computer Name and the Windows Account(from active directory) currently logged into the computer from which the page is being accessed.
So far, Im able to get the IP address and computer name but the windows account, am getting NT AUTHORITYSYSTEM
View 2 Replies
Nov 11, 2011
how can i run a application on windows startup for all user accounts on my computer?
View 3 Replies
Jan 30, 2011
I am creating a windows application using visual studio. I want somehow to insert an excel file into the application so the user will be able to download it from the program and save it to his computer. This means that the file will be a part of the program. There will be a button that will prompt the user to save the particular file somewhere so he can then view it.
What should I do in order to "embody" the excel file to the application? And what code should I write to link the file with the button?
View 8 Replies