C# - Create A Exception In Authorization Tag In Web.config?
Jun 14, 2010How i create a exception in location to allow access to page GanttViewer.aspx with other rol and others pages only with Admin rol
[Code]...
How i create a exception in location to allow access to page GanttViewer.aspx with other rol and others pages only with Admin rol
[Code]...
Is it possible to have location authorization nodes in a web.config be external?
Such that I could take all of the nodes simlar to
[Code]...
And move them outside of the web.config or something simlar? I find these nodes at an extreme amount of noise to a web.config when they're relatively static. Normally my approach would be to config source something like this but since it falls under the root node I'm not sure of it's possible with these nodes.
Somehow the User.Config file was corrupted for an instance of my VB .NET app. When access one of my user level config property (My.Settings.MyProp) I get the a ConfigurationErrorsException with the message "Configuration system failed to initialize." I looked at the User.Config file and found that it is empty, it can be opened but there is no XML text contained within.I would like to programmatically fix the file if an exception is seen. When I attempt to use any of my user level properties, I continue to get the same exception. I've tried calling the Reset() but that yeilds the same exception. I then tried Save() to see if it would write out a default version, but it appears to do nothing (the file is not updated). My.Settings appears to be useless at this point.How can I reinitialize the User.Config file to the default config settings without deleting the old file? I would think that there should be some mechanism for restoring this file back to its default. And how can I update/reinitialize the My.Settings instance so that I can access the properties normally?
View 17 RepliesI've moved my Database connection string into my app.config - however its causing a null exception error when i use it
App.Config
vb
<connectionStrings>
[Code].....
Is there anyway to create a Custom Exception without inheriting System.Exception?
my reason is that they have a lot of methods which i do not wish my Class to have.
how to configure the app.config file in vb.net, especially when I want to set up the smtpmail.smtpserver via it?
View 2 RepliesSo I get thrown an exception right when I try to create a new instance of my Web Service that says:
"Could not find default endpoint element that references contract 'KBBVehicleService.IVehicleInformationService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."
This is a web service that will connect to Kelley Blue Book. I know I need a new endpoint entry in my Web.Config, but what does this look like? The one I added looks like this:
<endpoint address="http://localhost:3300/KBB.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Default" contract="Services.Client.IVehicleInformationService"/>
But it doesn't work. Still throws the same exception at the same place.
how to create a global variable for this situation: I would like to store who logs in to a system (like, who is currently logged in, when he logged in) and then use that info for a transaction form, which will look like this: which admin made the transaction).
If I were to use a global variable, it would mean having to pass it onto several forms right (eg: from login form to the forms that will use the log information). I'm also thinking of just having a config file that will store the said login info that will be changed everytime a user logs in.
I know that when using my.settings that when I exit my app that it saves them and then next reload it imports my.settings back.
My question, is there a way to create this user.config file on the apps first load?
If I create a windows application. Where is the file for app.config? Can I modify it?
View 9 RepliesI am trying to build a form that has a button on it that will open up a 2nd form that allows me to view and edit the connection string. I believe the connection string is also called app.config, and can see that in the Solution Explorer for the project.All I have managed to do is drag a button onto my main form and relabel it. I have no idea how to create code to access the connection string.
View 2 RepliesI am making changes to my companies internal paysite in order to come into compliance with the new credit card regulations. We have decided that when we get a split tender transaction that comes through we want to get the remaining balance along with how much was on the card to start out with and send that info back to the customer service rep with a message relaying the need for another payment source along with the remaining balance and the amount that was originally on the card.
Instead of chaining the transactions together with the split tender Id we have decided we would like to finalize each split tender transaction with a prior_auth_capture and then request the next payment source and amount and process that transaction in the same manner. I know that we are side stepping the functionality some but those are my orders.
My questions are, is this feasible and possible and how do you do this in code? I am using the C# SDK to implement this in VB.NET 2008
My thoughts are that I would have to process the transaction for the amount passed as a auth_capture transaction and then some how do the prior_auth_transaction with a zero amount or something?
I am not capable of creating different users that have different authorization using vb.net.
View 5 RepliesI need to validate a basic authorization header that is being sent to my HttpListener in VB.NET. I'm grabbing the header like so (feel free to point out better ways to do this as well):
EncodedAuth = Context.Request.Headers.GetValues("Authorization")(1)
Now how do I decode them? I understand the theory but I can't seem to find the right code.
I made this login script and I want a user to download a file when they login. The download file button checks a folder named login. Once a user logs in it creates a folder named login then it allows the user to download the file. The only problem I have is that I don't know how to let the download button accept any user. Right now the person has to be named chris and they can choose what password they want. Also how do I allow the program to place the file on the desktop and not the test folder. I didn't know the code for it because each user has a
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[code].....
What code would I put in order to lock my software so that no one use it without authorization? I know this is the delphi
program Project1;
uses
Windows;
var
HardID : String = 'Enter Hardware ID here';
function GetHardwareID():string;
[Code] .....
How to post data in HTTPS authorization in .NET?How to get headers(cookies), get html code and set headers(cookies) in HTTPS?
This is code return HTML code (GET metod):
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim strRemoteHost As String
Dim strURLPath As String
Dim RemotePort As Integer
[code]....
I have a Asp.net Web Project using authentication mode="Forms". My login works perfectly. Now the Problem is that I have a link in a site that is only available to authorized users. It is possible that the pdf file of that link does not exist. What I want to do is to verify the availability of the pdf with a HttpWebRequest. Since the pdf file is only available for authorized users (web.config/location/system.web/authorization) I have to mark the HttpWebRequest as authrorized. But I don't have the logincredentials at this time (only when the user logs in and the .net framework wouldn't get me the password of the user). How to send the already established authorization with a new HttpWebRequest?
View 2 RepliesI have a class library (Named ADI), that needs some configuration settings from the project using it (like connectionstring, filesystem locations etc).
I want to define these settings in my Windows Forms/Web Projects App.Config or Web.Config, like other settings.
Here is part of my app.config for my windows forms application:
<applicationSettings>
<PhotoImportRobot.My.MySettings>
<setting name="ADIImageRoot" serializeAs="String">
[Code]....
is there any tool to validate configuration file?
View 1 Repliesi created the following ActionFilterAttribute to check if a user is granted access to a page. I also created two custom Exceptions to handle different scenarios: NotLoggedInException and InsufficientPrivilegeException.
[Code]...
Where do I catch the exceptions to for instance redirect users if not authorized?Should I perhaps use the SiteMap authorization somewhere else instead of using the ActionFilterAttribute and throwing Exceptions..?
note: as you can see I'm using a custom class for BLL.Page. This is a ORM page which has Role based security stored in the database. SiteMap is also populated based on this data
It is possible to catch an exception and throw a new exception which wraps the first exception as an inner exception: [URL] Also, if I call a function and it throws a certain error, but I catch it, will the calling code's catch handler execute? If so, and it is of a higher exception type, is this not wrapping the exception? eg I can throw exception ex of type IndexOutOfRange, log it but rethrow, catch a higher up exception and do something, or I can throw a new exception and wrap an inner exception like:
View 1 RepliesI am trying to make an oledb connection to an Access database.
1. I added a component class.It said drag from the toolbox to add components.
2. I dragged over the Oledbconnection and OledbdataAdapter
3. I clicked on new connection string for the oldeb Connection and try to connect to the SHX.mdb datababase in the debug/ bin folder I don't have a username or password for the database and do not want to set one up.( is this possible in .net?)
4.As soon as I try to test the connection, I get the "invalid authorization specification" message. I can't get past this and do not really understand why I am getting this message.I have vb 2005 standard edition, not express edition.The exact same thing happens when I try to set up the data adapter to the shx.mdb database.
I am on XP2 and not logged in with a password or username. Could this be the issue or is there something else I am overlooking.Also, since I am coming from vb6 and ADO is there anyway to just write the code without having to use datasets, adapters and oledb connections to bound controls?
Our main application has both a asp.net and winforms component. There is a class that is used by both sides and needs info from either the web.config or app.config files. The class itself does not know if it's on the client side or on the web server (at this point). We are getting errors when it's attempting read app.config when it's on the web side. Is there a way for the class to tell if it needs to read web.config or app.config?
View 1 RepliesI am trying to create a log file to log when an exception occurs (if it does) and what exceptions occured. I have posted the code I have so far. What I would like to do is be able to set the path I want it to go to (ie: C:VB ProjectLogs). I can run my code with the current Logging code but cannot find the file. Is there some sort of create command i need to use first?
Sub LogWrite(ByVal ex)
Dim time As String
Dim Path As Microsoft.VisualBasic.Logging.LogFileLocation
[code]....
I'm writing an installation program that needs to create a new Folder in the "Program Files (x86)" folder. I'm getting the following security exception:
System.Security.SecurityException was unhandled
Message=Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED)
What do I need to do to get around this issue and create the desired Folder?
I'm doing a small tool that basically wipes the document properties of each .*doc file in a specified folder. The code is working, however, if the document is already opened, I'm presented with a text box asking if I want to open a read only copy etc. I want the code to abort if that happens and rather write it down in a log file or something. And just move on to the next file. How can I do this? I'm talking about editing thousands of documents.
This is the code I have so far:
Imports Office = Microsoft.Office.Core
Imports Word = Microsoft.Office.Interop.Word
Imports System.IO
[Code].....
I am trying to create the Proxy from the WSDL using wsewsdl2.exe [code]...
But i am getting Invalid cast exeption.Can someone please tell me how to i fix it?
I am using VS.net 2003 with WSE 2.0 V3 and Soap 1.1 installed.
I have searched other forums, google, etc. and have not find a solution. I am creating a VB.NET application using Visual Studio 2010. My application runs fine inside the IDE. Outside of the IDE, it crashes immediately with an OOM exception. I have compiled the program in both VS 2010 and VS2008. The outcome is always the same. I increased my Desktop heap to 12288 meg from 3072 meg thinking that was the issue, but the outcome is the case. Although the increase does improve my response in the IDE. The error is also being reported as related to mscorlib.dll; and my version is for 2.0 framework is 2.0.50727 and for 4.0 framework is 4.0.30319. I am running Windows XP/SP3.
View 13 RepliesI tired this [code]...
but this code not working on windows vista, i can use it on windows xp, i think problem is user permissions but i have to delete or create file via my application how can resolve this problem.