Isolated Storage File Saving On The Default User Profile For A Web Service
Jul 8, 2010
I have a windows application that stores a file on the current user's isolated storage, lets call this user Adam. On the same machine I have a Web service (The Web Service's application pool is running with Adam's credentials) that uses the same dll to access the file on the isolated storage but it is trying to access a file on the Default User's profile instead of the real user's profile (in this case Adams Profile)
Why is it trying to look for the file on the Default User's profile Instead of Adam's Profile? How can i make it look for the file in the right profile?. I'm running it on Win 2003, C# and .Net framework 3.5
We have had complaints of users losing data that they entered in textboxes in our ASP.NET 2.0 web application. Users are authenticated using Web Single Sign On method. My boss would like to save the client data in a file on their local disk in case they lose connectivity. I know this is not allowed with the default security of ASP.NET.
Would it be possible to programmatically change the ACL permissions for the NETWORK SERVICE account to access the isolated storage folder on the logged in user's local disk? Is there a better way to achieve this goal of persisting user data to a file?
I am using profile services to store some attributes of users registered in the website. Now I am making a display profile page for a user. The problem is that the profile loads easily when I am running the site from VS 2010, but it gives the following error when I run it from IIS7 on my local machine:
System.NullReferenceException: Object reference not set to an instance of an object.
I have a website that acts as a common user details site for a few other websites. I pass a sersname to it and it gets the profile using
[Code]....
that part works fine. Now to commit the changes I use the above code to get the profilecommon for the user and then use oProfile.Save() to finish. This saves all the user data to my profile..doesn't matter which profile I use, it always gets saved to mine.
I Have the following code which fires OnCreatedUser and doesn't throw any errors. Profile.Title is getting set to the correct value when inspected after the assignment.
public void CreateUserForm_CreatedUser(object sender, EventArgs e) { var ddlTitle = (DropDownList)CreateUserWizardStep1.ContentTemplateContainer.FindControl("Title");
How do i set the default profile when a user logs in. I have an application where the users (once they are authenticated) are in either the logged in, premium, or promotion profile. right now it assigns none. How do i make every user automatically be part of the promotion profile.
I'm trying to store some business objects in a SQLProfileProvider Profile property, however my business objects use public properties, not fields. This means I can't serialize as binary (correct?) so I'm serializing as XML. I've got the basic XML.Serialization attributes on the business objects, basically just XMLRoot and XMLElements with Type properties and an XMLArray attribute for a collection<T>. When I look at the data in the aspnet_Profile table, sure enough, it looks like an XML representation of my BOs:
[Code]....
Additionally, it works fine while the user is logged in.However, if the user logs out and logs back in, the profile property is a new instance of the BO, not what was saved in the profile. What am I missing here?
I am logged in as user1, and while creating a user in which I have additional information which would store first and last name into the profile database. I have the following code
[Code]....
But because I just have profile like that, it is updating the profile of user1 not the new user i just created
I have a user control which, when pressing a command button, sets a property for the Profile (which has been marked as allowanonymous=true), then save it using Profile.Save().
Now, in IE this works fine - no problems at all. I then go to the page where the value is used - and it's there and can be used.
However, exactly the same routine when running in Safari or Firefox doesn't work - although when you're on the same page where the value is set it will immediately state that the value is ok, do a postback and it's gone!
Here's some very simple code to show the problem. Whilst IE will always dump 'plop true/false' to the screen (yes, I know - very juvenile!), FF and Safari will the first time, but on postback will just dump True to indicate it's a postback. (oh, and autosaveprofile is set to true in this example - otherwise there'd be a Profile.Save() below the set property).
[Code]....
I can't use Cookieless session states as the CMS I'm using won't allow it. I've also used Fiddler to try and track the issue, but no joy.
I'm guessing it's related to the way FF and SF handle cookies - but both are set to accept anything. Could it possibly be anything to do with the ASP.Net Development Server? (ie. the address is[URL]The fact that it never manages to save the value
I'm making another attempt to find out how to use a different profile in the web application. I though it would be quite simple. but couldn't find an answer anywhere.
All I need to know is how to call "i90ProfileProvider" instead of default "i90PartnerProfileProvider" in C# or VB.
Public Class CustomProfile Inherits ProfileBase Public Property AreCool() As Boolean Get Return Me.GetPropertyValue("AreCool") End Get Set(ByVal value As Boolean) Me.SetPropertyValue("AreCool", value) End Set End Property End Class
I don't know how to set the default value of the property. Its causing errors because without a default value, it uses an empty string, which cannot be converted to a Boolean. I tried adding <DefaultSettingValue("False")> _ but that didn't seem to make a difference.
I'm also using a custom ProfileProvider (CustomProfileProvider).
I would like to be able to give my users the ability to securely upload and store files, sometimes upwards to about a gigabyte in size. I'm not quite sure what's the best way to go about doing this. I would like to have the connection between the client and the server secured, so I'm sure I will probably have to use SSL. Now, my major crux is secure storage. Being that the data is somewhat sensitive, I'm wondering if I should encrypt the file before it is stored. I guess my question is, should I open the file and encrypt each byte or encrypt the file as a whole. I'm assuming that the latter is the better option. I know that there are a number of examples of how to encrypt a file using a number of different methods (aes, des, md5 (hashing not really encrypting), etc). Currently, to encrypt text, I am using the Rijndael algorithm, sha1, 256 bit keys, a predefined passphrase, salt value, and IV.
I'm currently developing a web application whose primary user function is uploading and downloading of files. The files will be stored on the hard disk (no cloud storage yet).
Taking into consideration the possibilities of gigabytes of data and a large number of files, do I need to organize files into sub folders to account for the fetching of a file or is the file system's indexing already very efficient and I can ignore this potential bottle neck?
Update:
On a side note, I plan to store file names and any additional information in a SQL database and only query the disk when a user actually wants to download the file. This is how I plan on retrieving files:
What is the best approach to storing images in a file system. Currently I am separating the images by day, month and then year. I am also hashing file name so that no two files will be stored with the same name. Lastly, how would I go about using the image file address in a forum?
How can I consume a default WCF web service, right out of the box from VS 2010 in a default ASP.NET MVC project right out of the box from VS 2010?
I know how to start up the WCF web service and add the service reference in the ASP.NET MVC project. So what I want to know is exactly what code I shall write in the ASP.NET MVC project?
I want to import csv file(already uploaded in blob storage) in Azure. For example I have uploded test.csv on blob storage, now i just want to import that test.csv file in .net(azure) and after importing i will insert that data into azure database. I am using C# .net.
Creating a cvs file with all rows. Upload it as blob. Parse it with a Worker role and insert it in the sql azure db.
I would like users to upload a profile picture when they register, and to then show that picture in a picture box control when they are logged in based on that specific user.
I am trying to use a second (custom) table to extend my users profile info. This table is in the same database as the 'aspnet_Users' table but has a different name. I create a FK relationship between the 'aspnet_Users' table and my custom table. Here is my web.config code:
I have the table "MyProfileTable_Employees" poplulated with data the 'userid' matches to the aspnet_Users table. In my web application (vb), when I type in Profile.MyProfileInfo, there are no custom fields. Actually, when I type profile., there are no profile related entries. What am I missing here? Am I miss-interpting what a custom profile provider is?
Protected Sub LoadViewer() ddl_viewer.DataSource = SQL_Viewer() ddl_viewer.DataTextField = ("view_group") ddl_viewer.DataValueField = ("view_ID") ddl_viewer.DataBind() ddl_viewer.Items.Insert(0, New ListItem("-- Choose --", "-1"))
[Code]......
this is my class
Dim sqlCmd As SqlCommand = New SqlCommand("Insert_News", ClsDBConn.GetDBConn) sqlCmd.CommandType = Data.CommandType.StoredProcedure Dim sqlParameter As SqlParameter sqlCmd.Parameters.Add(New SqlParameter("RETURN_VALUE", SqlDbType.Int)) sqlCmd.Parameters("RETURN_VALUE").Direction = ParameterDirection.ReturnValue
[Code]......
and this is my stored procedure
ALTER PROCEDURE [dbo].[Insert_News] -- Add the parameters for the stored procedure here @News_Title VARCHAR (500), @News_Viewer VARCHAR (500), @News_Message VARCHAR (300), @News_Author VARCHAR (100),
We are using Telerik RadEditor control in our project and having some problems with its integration with our user documents storage engine. We've implemented custom content provider for Telerik image manager and it shows correct documents in dialog. But in doesn't switch between images while selection. You can see this on this picture. We've tested this behaviour on the blank ASP.NET page without any additional CSS or JS. Rad editor tag could be found below. Please help! Why do this could happen?
I got the followig task.Create a website (Profile.aspx) in which the User can create and edit his profile.Well, I know how to write in a database, but how do I get the UserName oder the UserID to make a PrimaryKey?If the user is logged in a session will be started. In this session is the UserName but I don't know how to read out the UserName with ASP.NET to make an PrimaryKey. If I would try to read out the UserName with C# I must save it in an variable and give it somehow to my form.
Profile that is used for ASP.NET Profile Service is not available in Page code behind files like in Page_Load.
It may be just a problem with Visual Studio installation/configuration, but as another problem, classes placed in App_Code in not seen in page codes. Even when I'm adding new ASP.NET folder to my project, "App_Code" is not available as an option.
I tested the entire scenario with ASP.NET Web Project and Empty ASP.NET Web Project. This problem does exists while creating ASP.NET Website.
Environment: Visual Studio 2010 Ultimate x64, ASP.NET 4.0, Windows Server 2008 R2 x64.