How do I find the server name I'm runing? [duplicate] - asp.net

This question already has answers here:
How do I get the local machine name in C#?
(5 answers)
Closed 8 years ago.
I'm building a web page with visual studio 2010. I want to used pass word recovery control. I need to find out what server Name is, so I can use SMTP setting to send emails to the user who forgets his pass word. I don't know how to get it. Does anybody know. I appreciate it very much.

My.Computer.Name should do the trick in VB. #Vache said that My.Computer does not exist in C#.
Or
System.Environment.MachineName, as pointed out by a commentor.
It looks like System.Environment.MachineName may be preferred, as that is a static method. My.Computer.Name seems to be added at the project level; when I just tried it in the Immediate Window within a solution that has numerous projects, the call was ambiguous. I had to fully qualify it by a project's namespace before I could get the value. E.g., MyNamespace.Project1.My.Computer.Name. However, you shouldn't have to qualify it if you call it from within a project instead of a global area like I did.

Related

how can i cancel saving the form's records automatically in ms-access 2010 macro

i designed a form in ms-access 2010 . it's based on a table . i want that when the user enter data into the form and shift to the next or previous record the last record he had been in, by default changes to read-only property to prevent the user from editing any data by mistake
i hope the answer be by ms-access 2010 macro
second question :
actually , i googled my question before asking but i failed the real reason
when i designed a program in ms-access-vba to be used across multiple pcs , i face a big problem
the problem that the code does not work at all on some pcs unless i setup a version of windows 7 on the pc that the code doesnot work . and this solution is annoying and impractical
i hope to solve this annoying problem
that's why i ask every time from you all that answers be by macro not by vba .although i love vba but macro proved to be the alternative soultion to this problem
what shall i do?
any ideas for that problem
thank you very much in advance
There is a property you should check Form.DataEntry allows you to enable the form to ONLY add new records, but not editing.
Form.DataEntry property (Access)
Play with VBA, make the form as only to add records, and then allow users to edit records only if they click in the button to edit. That way you can prevent mistakes as you wish.
I do now know how your database is designed and how your forms are designed/linked, but what I do is loading the same form in 1 mode or another (adding or editing), depending where the user clicks. That way, for me, is easier to control mistakes.

How to keep track of users that belong to different companies in asp.net-mvc? [duplicate]

This question already has answers here:
ASP.NET MVC - Set custom IIdentity or IPrincipal
(9 answers)
Closed 6 years ago.
I have an application where I have created a authhenticaton login with the help of entityframework IDENTITY.
The point of this application is alot but for the relevance of this question it is that it should be used by several users that even perhaps belog to different companies. For this I assigned an OrgId in the usertable in the DB.
The thing I am trying to figure out is the best way to get this OrgId.
Every time a user logs in I get this info but I don't want to check the users info with each request or save to the db.
While searching for this i stumbled accross using a global variable like so:
ASP.NET MVC Global Variables
Which gives me an idea of how I can do this but I don't want to come to an impass weeks from now and realize that this was not the best way to go about doing this.
I'm searching for a good way of accomplishing what I am trying to do, pros, cons etc.
If you're using ASP.NET Identity, I suggest using claims to set additional information about the user.
You can set the claims once the authentication is successful.
See the following for more information:
Link 1
Link 2

android ListView not getting updated after a modification to it's cursorLoader

I am new to android and java and working on an app that has a few remaining problems that I haven't resolved yet.
I have a main activity that is a viewPager, with each page being a fragment. If the 4 fragments 3 are extended from ListFragments and one from PreferencesFragment.
The ListFragments have CursorAdapters to get data to and from SQLite databases through providers.
I am able to get data into the database, insert, modify and query the data correctly and fill the list views ok.
My preference setting are to choose different ways of viewing the data in the database.
Not knowing how to do this, I have implemented a process where I modify the cursorLoader query to the provider with a number of different choices of the "WHERE" clause. I have worked out the logic for the preferences as they exist now, implemented the code but had some difficulty finding what to try to trigger the refresh of the ListView.
Since the "dataset" hasn't really changed, no trigger can come from there, plus that would just use the same cursor as it currently exists to run the query again and return the same results (or be smart enough to know that it doesn't need to run).
On Stack Overflow I did find a couple of references to a similar implementation that suggested reStarting the cursor loader, which would then on the reStart read the current values in the stored Preferences file, create a now modified WHERE clause that will show the sub-set of data as specified in the preference settings.
In testing the app now, even with the reStart of the cursorLoader, the ListView isn't getting refreshed.
The only time I can get it to work right is restarting the app. If I stop the app and restart it, the new values are used and the ListView presents as the preferences dictate.
In looking through Stack Overflow and the Android site, I did find another set of APIs that might have been a more natural fit for what I am trying to do, namely the Filter APIs.
First question then would be, did I go in the wrong direction on how to control the "filtered" view of the datbase. Is filtering a better approach and a recommended way of
doing what I am trying to do?
Second question would be related to the fragment lifecycle of my ListFragments to achieve this CursorLoader update.
Thanks for any input on the topic.
-Dan
Found my problem here.
Two things, the way I am trying filtering is working and from what I have seen in the
Android development site, a reference there indicated that the filtering capability is
already implemented in the CursorAdapter, CursorLoader classes I am using.
When my preference settings changed, I did a reStart of the cursorLoader, but had restarted the wrong one.
Problem solved. Any input on is there a better way would be appreciated.
Regards, Dan

Filtering Data in ASP.NET Web Services

I've been using this site for quite a while, usually being able to sort out my questions by browsing through the questions and following tags. However, I've recently come across a question that is rather hard to lookup amongst the great number of questions asked - a question I hope some of you might be able to share your opinion on.
As my problem is a bit hard to fit into a single line, going in the title, I'll try to give a bit more details on the problem I've encountered. So, as the title says I need to filter, or limit, some of the response data my standard ASP.NET Soap-based Web service returns on invoking various web methods. The web service is used to return data used by other systems (a data repository more or less), where the client today is able to specify a few parameters on how the data should be filtered and in return a full-set of data back.
Well, easy enough I thought, just put additional filtering options on the existing web methods which needs a bit more filtered applied, make adjustments on the server-side and we are all set to go - well, unfortunately it turned out to be a bit more tricky then this.
The problem I am facing is that I'm working on a web service running in a production environment, which needs to be extended in such that additional filters can be applied to existing web method being invoked w/o affecting the calls already being made by other systems used by the customer using their client stubs. This is where I am a bit troubled, since I can't seem to find a "right solution" on extending the current web service.
Today, the filter is send as a custom data structure which holds information on which data should filtered, but I am not sure if I can simply just add more information to this data structure w/o breaking code at the clients? One of my co-workers suggested that I could implement a solution where I would extend the web.config on the server-side to hold a section with details on which data should be excluded (filtered out), but I don't find this to be a viable solution long-sighted - and I don't trust customers with such an option since this is likely to go wrong at some point. So the solution I am looking for is a way that I can apply a "second filter" to the data I am requesting from the client so instead of getting a full-set of data back it should only give a fraction, it implemented in such that the filter can be easily modified and it must not affect the current client calls.
Any suggestions on how I should approach this problem?
Thanks!
Kind regards,
E.
A pretty common practice is to create another instance of the application OR use part of the url to signify the version of the endpoint they are connecting to, perhaps the virtual directory is the date. That way old calls will go to the old API and new calls will come in on the new API.
http://api.example.com/dostuff
vs
http://api.example.com/6-7-2011/dostuff

Flex 3 + Flash Player 10 FileReference save function [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
help, losing extension when use FileReference download
Hi!
I'm having an issue that looks common when using the FileReference class in FP10 when saving a file.
The whole thing works fine as long as I don't change the default filename. If I do, then I loose the extension of the file... which is annoying >_<
I haven't found any "acceptable" workaround, but the posts I've seen are from a couple of months already. So I'm inquiring hoping that something's been done regarding this issue since then =)
Regards,
BS_C3
The only thing i am aware of that you can do is: After succesfull saving check the filename and display a warning if the user used the wrong/no extension.

Resources