Get Website Name using asp.net [closed] - asp.net

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
i want to get website name using asp.net
i have one website that website contain generic handler page. so my client's website send http request to my site. that time i want to validate whether the request come from my client website or any other site?. so how to find the website name?
I want to create api to send and receive http request. so thats way i need this coding.
Request Example:
http://MySite.com/GetRequest.ashx?mobile=9894380156&opt=RA&amt=10"
Response Example:
Recharge Accepted

Websites don't have a name property that you can pickup, but you can check various properties of the Request object and attempt to infer the origin of the request. For what I think you're trying to do you'd probably need to maintain a list of IP addresses/domains for your client sites and code some logic for this yourself.
Hope this helps.

I think what links between you and another website is the URL and you can use the information available in the new Uri("Your Site URL") and it can provide you with some valuable information about the url u are calling.

Related

Checking to see if their zip code is eligible [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Hello I am working on a web page in drupal. One of the content is about a scholarship and there are certain zipcodes that are eligible for that scholarship. I was wondering if there is to have a search box within that web page were the user types in there zip code and than tells you if they are eligible or not I was thinking some javascript, but I was wondering if there is any better ideas. Thanks!
Sure, you could use javascript on the client side or php (as Drupal is in php) on the server side. The tradeoff with the javascript approach is you'll have to send all the valid zip codes (or some rule that computes them) to the client every time your page is loaded. But the upside is then it'll be very fast for the client to try various zip codes (since no server communication will be needed). And this may be easier for you to code.
For your use, you'd probably get better overall performance doing this in php on the server. But then you'll need to be familiar with some form of client-server communication (ajax for instance) so that you can send the zip code back to the server and listen for a response.

No required "Session Timeout", [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
In my project session was only available for 30 minutes (Which is by default).
BUT... I want to disable this kind of session timeout. Means I required unlimited time for session by which my website never get log-in process again.
NEVER do this!
If user press X button on his browser his session (and all it's objects) will always be kept in server memory!
The solution is keeping ASP.NET Session alive using this simple javascript hack, not making extremely long sessions.
Javascript forces the page to post empty data to the server, it's a kind of ping.
Server doesn't post anything back but the session timeout is automatically resetted.
You can configure session time on 20 mins, and ping timer on 19 mins.
try this
maximum session timeout
<configuration>
<system.web>
<sessionState timeout="525600"></sessionState>
</system.web>
</configuration>
try that it increase timeout. if you want to store login info use cookies
<configuration>
<system.web>
<sessionState timeout="525600"></sessionState>
</system.web>
</configuration>

Decoding MIME/SMIME Messages in Biztalk [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am developing a sample Encryption/Decryption solution in biztalk. for that purpose I created Test certificate by using Testcert utility. Then I successfully encrypted a message through MIME/SMIME encoder using test certificate. My problem is when I try to decrypt the previously encrypted file I get following error message:
There was a failure executing the receive pipeline: "EncryptionDecryption.ReceivePipeline1, EncryptionDecryption, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de95fc107454e1ca" Source: "MIME/SMIME decoder" Receive Port: "ReceivePort4" URI: "C:\BIZTalkProjects\EncryptionDecryption\DecIN*.xml" Reason: There was an authentication failure. "Failed to decode the S/MIME message. The S/MIME message may not be valid.
What could be the reason? please help me. I am using biztalk server 2010.
Regards,
Shabbir
Did you check the procedures to write and read out the data? Decoding usually happens before the content is decrypted. Make sure that the file is complete and fully available in memory before the decrypt methods are called.

Encrypt your hard disk in C# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
How to secure a hard disk programmatically through C#?
Like if a user wants to open a hard disk and first he/she has to give a password to access it. If the password is wrong then the hard disk is hidden from that user..
If you're trying to do this inside an app written in C#:
Get logical drives:
string[] drives = Directory.GetLogicalDrives();
Also check this out:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23825199.html
http://bytes.com/topic/c-sharp/answers/276247-get-drive-letter-win32_diskdrive
You'll need to expand that more. Associate a drive letter with a password and keep that stored somewhere. If the entered password is correct, show that drive as you already have a list/array of them. (note it's too early for me to write this all out and I have a cold - but it's fairly simple).
You have your list of drives, you check a password to see if they can see a drive, if so let them see it.
If you are trying to restrict the entire windows system from showing drive letters based on a password, I would say do not use C#. This is a windows security issue.
I would recommend reading abot MS Group Policies. This article can help you:
http://support.microsoft.com/kb/231289
I don't think this can be done transparently (you can access the file with any program) and securely (that is, the disk is actually encrypted, not just hidden from the shell) in C# (on Windows, not on Singularity). To decrypt the disk on the fly you need a kernel mode driver. And you can't write that in .NET.
On Linux you might be able to write a FUSE (usermode) driver in C#+Mono.

How to restrict a user to enter data when a session expired in ASP.NET? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I have developed a ASP.NET application,I have used sessions for parameter passing.
I dont want to let the user to enter data when the session expired.Please suggest me how to do that.
Create a base page, inheriting from System.Web.UI.Page and in the on load event check your sesion object and if its null then redirect to the homepage and then have all your pages inheriting from that.
However as already commented on by others you database connection should not be left open anyway. Your UI shouldn't have any knowledge of your db connection. Your business layer is where you should be using your db connection.
In your business layer assuming your are using SQL you should have a statement something like:
using (SqlConnection con = new SqlConnection(connectionString))
{
}
At the end of the using statement your sql conection will be disposed. For more information, you might want to look at this article:
MSDN SqlConnection
Thanks
Paul

Resources