|
|
I always load the roles from the database on every call instead of storing it in Session.
|
|
|
|
|
|
The proper way to handle this is to create an Authentication Provider and use the web.config to configure app to use it.
http://msdn.microsoft.com/en-us/library/907hb5w9.aspx[^]
Also, this should have been posted to the ASP.NET forum since it clear deals with ASP.NET specifically and not C# in general
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You probably already know this, but (just in case) you can add authorization in Web.Config also...
<authentication mode="Windows"/>
<identity impersonate="true"/>
<authorization>
<allow users="SomeDomain\SomeUserName"/>
<deny users="*"/>
</authorization>
|
|
|
|
|
dear Timothy CIAN /Ennis Ray Lynch,
I cannot add 500 domain\user name in webconfig..
i had a table that has columns
FName EMPID UserID
Tarun 1 domain\tarun
I am creating a intranet web application
1) requirement i used not be displayed the login form. they should be view my webapplication
2) if there are 1000 employees and only 10 employee information is stored in the database then only 10 employeessy should be able to browse the application. rest should not be
3) requirement. if the user browse the application or pages .. i should be able to store some information like userid in session or in whatever.. so that i should not hot the database again and again to check whether he is valid user or not.
4) so i thought of creating a generic class or global.asax.
5). all the article i saw were using cookies and forms authentication(is this the only way.. i mean i dont want to use cookies)
|
|
|
|
|
please do not remove messages, it is against the forum guidelines.
|
|
|
|
|
READ THE DAMN GUIDELINES
Do not remove or empty a message if others have replied.
What part of this is not getting through to you?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi, I'm able to close all processes including IE but I can not close the file explorer windows. They are not process I think because I can't see them among the processes. Any clue welcomed, thanks
|
|
|
|
|
Found this somewhere - you can probably try it out.
I don't know if this will work though.
int myHandle;<br />
while ((myHandle = Win32.FindWindow("ExploreWClass", null)) > 0)<br />
{<br />
Win32.SendMessage(myHandle, Win32.WM_SYSCOMMAND, Win32.SC_CLOSE, 0);<br />
}
Quidquid latine dictum sit, altum videtur.
Whatever is said in Latin sounds profound.
|
|
|
|
|
thanks, I've seen and tried that but even though I can find the Win32 namespace, FindWindow() method is absent.
|
|
|
|
|
Then you should pinvoke FindWindow and SendMessage - those should be on www.pinvoke.net with examples of how to use them.
|
|
|
|
|
Like most P/Invoke examples on the net, that one won't work on 64-bit Windows. The return type of FindWindow[^] is HWND, which must be represented as IntPtr in .NET. Using int for HWND will truncate the handle's value if you're lucky; and if you're unlucky it will mess up stack alignment and cause your program to crash in an unrelated location some time later.
|
|
|
|
|
Hi
I'm creating a desktop application that will act as a portal to various other services. One of these services include GMail. How can I implement Single Sign On so that users can log in to the portal and access their email straight from there without loggin in again? I know that I have to use Google's implementation of OAuth to achieve this, but I can't find any good examples anywhere. Has anyone got some tips?
At the moment I'm trying to request a token. I have to create a call to OAuthGetRequestToken , but how do I create this call?? Is it as simple as webBrowser.Navigate("https://www.google.com/accounts/OAuthGetRequestToken") . I also have to pass in parameters such as oauth_consumer_key . Again, where do I get this key? And how do I pass it in as a parameter? I'm totally clueless here and any hints/examples would be appreciated
|
|
|
|
|
Hi,
I want to initialize a string array with "*".
I want to know if I can avoid using a for loop to do the same.
In the below example I have used a for loop. Can the same done in one line???
The following code will help me generate fibonacci series
public static int Fibonacci(int n)
{
int previous = -1;
int result = 1;
for (int i = 0; i <= n; ++i)
{
int sum = result + previous;
previous = result;
result = sum;
}
}
|
|
|
|
|
what is this!!!
EASY COME EASY GO
|
|
|
|
|
new String('*', 10).ToCharArray();
|
|
|
|
|
Close but no cigar. That results in a char[], not a string[].
string[] sa=new string('*', n).Replace("*", ".*").Split(".".ToCharArray(),StringSplitOptions.RemoveEmptyEntries);
is one way of getting it done.
string[] sa=new string('*', n).Replace("*", ".*").Substring(1).Split('.');
is an alternative.
|
|
|
|
|
Happy :p
string[] arr = new string[0];
for(int i = 0; i < 10; i++) {
string[] temp = new string[arr.Length+1];
Array.Copy(arr, temp, arr.Length);
temp[arr.Length] = "*";
arr = temp;
}
|
|
|
|
|
That was awesome Stephen. Thanks
I never knew that an array can be instantiated with a new kewword.
I have incorporated your suggestion in my application.
I am now using "char[] str7 = new String('*', result).ToCharArray()"
This should handle one part of my application.
I have one more question.
Is it possible to convert this array of characters to a string?
something like reverse of what you showed me.
regards,
Netquestions
|
|
|
|
|
His name's not Stephen. I can understand the confusion, but the Stephen referred to in his signature relates to the author of the quote.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I prefer Denny Crane anyway.
|
|
|
|
|
Something like this -
string aaa = new string(str7, 0, str7.Length);
would return you a string of "***", if thats What u're looking for.
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
there isn't a straightforward formula that yields Fibonacci numbers without iterations; the closest you can get AFAICT is by using Binet's formula (see here[^]) but for large numbers that will be an approximation as it relies on floating-point arithmetic.
|
|
|
|
|
string[] sa=new string('*', (int)Math.Round((Math.Pow(0.5+Math.Sqrt(1.25), n)-Math.Pow(0.5-Math.Sqrt(1.25), n))/Math.Sqrt(5))).Replace("*", ".*").Substring(1).Split('.');
works quite well.
|
|
|
|