I have given a task in which I need to encrypt an user's ID using AES encryption, what they want is I need to pass in a parameter in a website just like this.
[URL]
Parameter : ?param= encrypted text
aside from that there was an attched php sample that they want me to follow to encrypt but I don't have an idea on how to convert this one in .NET
function getEncrypt($sStr, $sKey, $sIV){
$sCipher = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sKey, $sStr, MCRYPT_MODE_CFB, $sIV);
return bin2hex($sCipher);
}
$sStr = "13410##13";
$sKey = "mediaservice1234";
$sKey = "kjcemsdev3jangho"; // Do not change
$sIV = "fs0tjwkdgh0akstp"; // Do not change
$tmp= getEncrypt($sStr, $sKey, $sIV);
I've implemented IHierarchicalDataSource, IHierarchicalEnumerable and IHierarchyData. The TreeView displays everything correctly. But where should I specify the URL that should redirect the user where needed when he clicks on the TreeView's item?
I am looking at implementing a custom MappingSource as side project. It needs to be something along the lines of AttributeMappingSource and XmlMappingSource, except that it won't be using attributes or xml. This has been a problem so far. All the documentation I've seen uses these two, and only these two. I know how to define the new classes and implement the abstract methods, but there are a few problem. Let's take a look at the mapping source first:
public class CustomMappingSource : MappingSource { protected override MetaModel CreateModel(Type dataContextType) { // it is suggested to create a new metamodel and pass in // the current metamodel held in the datacontext. return new CustomMetaModel(GetModel(dataContextType)); } }
Ok so far, except that it's a new generic context, and no model exists yet. For example, I want to be able to do this:
DataContext = new DataContext(connectionString, new CustomMappingSource());
Now let's look at one of the CustomMetaModel's overriden methods:
public override MetaTable GetTable(Type rowType) { // there are no methods or collection exposed in 'this' to // add, remove or alter the table mappings. }
How do I do this? as you might be guessing at this point, I am looking into building a FluentMappingSource. NO! Don't point me to FluentLinqToSql. I have it and their mapping source isn't even derived from MappingSource.
i have a requirement that i need to download xml file from ftp and store it in a local folder and i have to read the xml and store it in my database. So i need to read the xml file and insert into database as bulk way. not instant insert. so which would the best way?
I am starting development of the new project and since I am new in the WCF world I want to ask your advice.I am going to implement web-service which will provide data for WPF client and for ASP.NET site. Web site and web service should be hosted in the Windows share hosting (not didicated server) and this fact is bothering me. WPF client and web site will provide almost the same functionality for the user, so I want to implement all logic inside web service not to duplicate it in the client and web site. Not sure what is the best way to implement such web-service - REST, SOAP or something else? Please, help me with selecting technology for web-service creation, I just want to get direction for optimal solution. 10x.Update: Sorry I did not wrote details. Service will be something like on-line shop with admin panel, so web service will be used for getting products and for adding new product to the system. It does not support tons of customers, it's just solution for small web-shops.
I am implementing an eCommerce application using ASP.Net. I would like to know if custom Google search is sufficient enough or if we plan to go implement our search functionality.. how do we go about doing it?
I am building a web application in ASP.NET using C#.NET which sends a SMS using clickatell.I am trying unsuccessfully to receive a status back from clickatell by creating a CallBack Page called ClickatellCallBack.aspx Here is the codebehind of the Page:
public partial class ClickatellCallBack : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e)[code]....
Basically, this Page retrieves the Query String values sent from clickatell and inserts them into a database table.I have registered the following Callback URL:
http://www.mydomain.com/ClickatellCallBack.aspx with clickatell and selected the Callback Type: HTTP GET
In my 'sendmsg' command I set delivery acknowledgement and callback request as follows: deliv_ack=1 and callback=3
The only problem being that nothing appears to be happening. The CallBack URL doesn't appear to be reached by clickatell.Do I need to implement this Callback URL using something other than an ASP.NET Page? Is there some clickatell setting I'm missing?
i have implemented the the openid in my page using dotnet open id when i get authenticated iam storing the details provided by openid provider in my database and creating a session of that username and redirecting the user to login protected page it is working fine but some time if i left the page idle for some time and then do any kind of postback then the session is lost and my page do not allows me to do any thing as it is login protected some time it is working fine without any problem. can you suggest me why is it so.
I'm looking to implement a membership system using OpenID for my ASP.NET application, similar to the system used here on StackOverflow. I'm aware that the OpenAuth library is generally recognized as the way to go, but I'm having trouble figuring out how to implement it.
I use NHibernate to persist my domain objects. I have a Users table with a username column, email column, etc. I'm not sure how to integrate OpenID with my own users table, and I haven't found any good tutorials on this. Does anyone have any experience with this? What is the best way to go about doing it?
I am doing web based projects in dotnet. Currently I am implementing security using session variables. I keep current user id and user type in session and authenticate user from these session variables (say Session["UserId"],Session["UserName"] and Session["UserType"]).
I've heard that such security can be broken and applications can be hacked very easily, like it is possible to get session id and directly connect to that session id etc.
I am implementing an multilingual web site using ASP.Net. The languages are English,French and Arabic. Please note that Arabic's direction is RTL. What is the best way to implement the multilingual support. I am planning to use the .Net localization feature but the website texts are stored in DB. For the controls ( form controls) , I can used resx file. Do I need to build two different pages ( one for LTR and another for RTL )? Or can I have one ASPx file for all the three languages?
I would like to hear some best practices in implementing these kind of web applications.
I want to implement a forgot-password feature in asp.net mvc that allows users to reset their password, and have some questions in this regard: Lets say that before allowing users to reset their password, I want to verify some extra information such as their first and last name. This info is not stored by default in the table created by aspnet_regsql. What is the recommended approach to address such issues?
Should I store this kind of info in a separate table, and use table joins to verify OR should i modify the schema of the table generated by aspnet_regsql (how?) so that I don't have to use joins? Do I need to write a custom provider OR would that not be necessary? I have read at places e.g. in this post that instead of emailing a temporary password, an alternative is to email a URL that when clicked allows users to change their password. How is this done? How to ensure that the URL expires after 1 hour?
I have a page which gives user to generate report based on different filters selected. my thoughts Loop through each filter control (checkbox, multi select list, radiobox list) and build dynamic where conditions and conjunctions for each filter and then run query Get all the data (i think this will causes an overload with all 4-5 tables joined) and then use Linq to filter this data based on user selection Is there a better way to implement this?
I need an example on how to implement AES encryption/decryption in .NET. I've been googling but haven't yet found any good examples. I've for example found AES example whih after some research wasn't 100% AES. I have to make sure by AES encryption/decryption is 100% AES, as I have to send email to the authorities explaining how I use AES (with secret key all), so they can hire some encryption expert which verify that we encrypt/decrypt it correctly. So he can verify that the what I implemented in AES is actually 100%. I'm reading the AES standard and how it's to be implemted in .NET Here is some code I'm having trouble with:
[Code]....
Which throws an CryptographicException: Specified key is not a valid size for this algorithm.
i am new to webforms and come from a php background.
when creating complex web apps in php i usually have a lot of global functions in an includes file. these functions are then made available to other php pages.
I running my static analysis checks again and I'm getting 100s of nags on
Label foo = new Label(); //Where this is an ASP.NET web forms label
Do I need to call dispose on these web forms labels? Also, how late in the page life cycle is it safe to call Dispose on these? If a class implements IDisposable, but doesn't actually do anything in it, is there any harm in not calling dispose?
(Yes, I have already read that closing connections is a good thing and using blocks are a good thing, too.)
DataSet is another class that seems to implement IDisposable for inexplicable reasons.
I need to implement an AutoComplete feature for a voting system with drop down names. Here is the code for the multiple text boxes. All need to have the same drop down names, which I would like to hard code, and not put in a DB.
[Code]....
I don't really know how to do an AutoComplete function. I've searched on the internet, but none are simple, and none are quite what I'm looking for.
I wanted to display the relative time difference in my razor view page.
In my model, which I am passing to the view, in which I have a dateTime datatype variable. Now, I want to implement a funtion
like this
[Code]....
I am unsure how should I define my funtion and call it inside my razor view. In the funtion, I will only pass the Datetime variable. It should only return the time in string format.
I'm working on a project that involves exporting HTML to PDF. I was told that this can be accomplished with a a free library called ITextSharp:http://itextsharp.sourceforge.net/This looks like it's actually a JAVA-based interface. Does anyone know how to actually inistall this and reference these dlls in your ASP.Net project? Maybe there there's a different version of ITextSharp for .Net that I missed...
for reasons beyond the scope of this discussion (say xcopy an aspx page to a directory, so that we dont have to get a new build out) , we would like to implement an interface in an aspx page.Say, if the page is myPage.aspx, it is usually your class in the codebehind mypage.aspx.cs which implements the interface. When I do something like this
Parser Error Message: 'ICustomInterface' is not allowed here because it does not extend class 'System.Web.UI.Page'.
How ever, when not specifying an Inherits attribute the page does not throw an error. So by default, when we do not specify an Inherits attribute, the page inherits from System.web.UI.Page ?
We are using VS2008 web application project and are not precompiling the aspx pages. We would like to intercept the request to this page in the HTTPModule (begin request) and if the request is to a page of type ICustomInterface we would like to process it differently.
We have a WebForms Control which requires that the ID of another Control implementing ITextControl is provided.What exception should we throw if there is no control with that ID or a control is found but it's not implementing the interface?
[code]... Should we split it into two cases and throw one exception if there is no control with that ID, and another one if said control does not implement ITextControl?If so,which exceptions should we use then?