Reputation: 3281
I have a method in my .NET Class which has to implement security based on Caller-ID. I am curious if there is some way to tell where the call to my method came from ?
Upvotes: 0
Views: 144
Reputation: 61339
Not easily. Using the diagnostics library you could potentially get there, but it wouldn't be pretty, easy, or extensible.
You can restrict method access with:
private
: Only class members can access itprotected
: Only class members and members of derived classes can access itinternal
: Only members of classes within the same assembly can access itIf you can't trust your own code, you have bigger problems.
Upvotes: 0