473,587 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieving the callstack

Nak
Hi there,

Is it possible to retrieve the callstack at runtime in a VB.NET
application? I wish the verify that specific methods have been called as a
security measure. Thanks in advance.

Nick.
Nov 21 '05 #1
6 6788
Nick,
Is it possible to retrieve the callstack at runtime in a VB.NET
application? Have you looked at the System.Diagnost ics.StackTrace &
System.Diagnost ics.StackFrame classes?

They provide a callstack at runtime.

I wish the verify that specific methods have been called as a
security measure. I would consider incorporating or extending the .NET security before
attempting to role my own.

http://msdn.microsoft.com/library/de...pplication.asp

Hope this helps
Jay

"Nak" <a@a.com> wrote in message
news:OA******** ******@TK2MSFTN GP12.phx.gbl... Hi there,

Is it possible to retrieve the callstack at runtime in a VB.NET
application? I wish the verify that specific methods have been called as a security measure. Thanks in advance.

Nick.

Nov 21 '05 #2
You might want to look at the StackTrace class.
http://msdn.microsoft.com/library/de...classtopic.asp

hope this helps..
Imran.

"Nak" <a@a.com> wrote in message
news:OA******** ******@TK2MSFTN GP12.phx.gbl...
Hi there,

Is it possible to retrieve the callstack at runtime in a VB.NET
application? I wish the verify that specific methods have been called as a security measure. Thanks in advance.

Nick.

Nov 21 '05 #3
Hi,
Check out Environment.Sta ckTrace

"Nak" <a@a.com> wrote in message
news:OA******** ******@TK2MSFTN GP12.phx.gbl...
Hi there,

Is it possible to retrieve the callstack at runtime in a VB.NET
application? I wish the verify that specific methods have been called as a
security measure. Thanks in advance.

Nick.

Nov 21 '05 #4
Nak
Cheers :-)

"Shiva" <sh******@onlin e.excite.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi,
Check out Environment.Sta ckTrace

"Nak" <a@a.com> wrote in message
news:OA******** ******@TK2MSFTN GP12.phx.gbl...
Hi there,

Is it possible to retrieve the callstack at runtime in a VB.NET
application? I wish the verify that specific methods have been called as
a
security measure. Thanks in advance.

Nick.

Nov 21 '05 #5
Nak
Cheers :-)

"Imran Koradia" <no****@microso ft.com> wrote in message
news:uO******** ******@TK2MSFTN GP12.phx.gbl...
You might want to look at the StackTrace class.
http://msdn.microsoft.com/library/de...classtopic.asp

hope this helps..
Imran.

"Nak" <a@a.com> wrote in message
news:OA******** ******@TK2MSFTN GP12.phx.gbl...
Hi there,

Is it possible to retrieve the callstack at runtime in a VB.NET
application? I wish the verify that specific methods have been called as

a
security measure. Thanks in advance.

Nick.


Nov 21 '05 #6
Nak
Hi Jay,
Have you looked at the System.Diagnost ics.StackTrace &
System.Diagnost ics.StackFrame classes?

They provide a callstack at runtime.


Cool. I shall check them out.
I wish the verify that specific methods have been called as a
security measure.

I would consider incorporating or extending the .NET security before
attempting to role my own.


Indeed I have, my application has a strong name key and requires a
signed XML license file in order to run. Technically, the only way to crack
my application now is by decompiling it, rather than creating a simple patch
for it. But just incase it is possible to make an application skip certain
lines of code without modifying the executable I would like to make a
mechanism that checks the callstack to insure that a valid license has been
acquired, that way I can add this throughout my application at key points,
*technically* making it harder to crack.

I know it's never going to be crack proof but I'm happy with this
concept.

Cheers again :-)

Nick.
Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5941
by: Zeng | last post by:
Hello, In my code, when I run into an error, I would like to dump the callstack into error log, how do I do that w/o throwing an exception then catching it just to get the callstack? Exception structure has callstack information but I thought there must be a way to directly retrieve it. Thanks!
2
7264
by: asanford | last post by:
We use StackWalk(StackWalk64) from dbghelp.dll to walk our callstacksas needed, using the various Sym* methods (SymGetSymFromAddr, SymGetLineFromAddr) to resolve source file, function name, and source line number for each frame. This works fine for unmanaged code, but when we have a call stack that goes into or through some managed code, we...
0
2052
by: Andy | last post by:
Hi All. I'm working for a company that has set out a guideline for retrieving data from a database. Nobody can explain to me the reason for the following. When retrieving a set of records from database to a VB.net app, they retrieve the database fields as a record set eg. "select name, suburb from myTable"
2
15696
by: Sakke | last post by:
Hello! We have written a GCryptoSvr.dll COM server in C++. Inside that resides WebClient COM component. WebClient CLSID is {8DC27D48-F94C-434B-A509-C3E1A3E75B9E}. When we are using that WebClient COM component from C++ code it works just fine. However when we try to use that same WebClient in the same machine with following C# code: ...
11
2494
by: seannakasone | last post by:
Is there a way to get the callstack level in c++? for example, take the following code: void call3() { //callstack level would be 3 } void call2() { //callstack level would be 2 call3();
3
2788
by: phocis | last post by:
I wrote a pair of functions to enable scoped or referenced setTimeout calls. I did this because I have an object factory that creates multiple objects and those objects need to delay a few calls on themselves at a certain point in time. This code works fine for normal objects. However, my issue occurs if at any point, an event object is...
3
1583
by: Rainer Queck | last post by:
Hi NG, currently I am working on a add-in which shell read the callstack and write it to a file. The question is, how can I read the current callstack of a debugged application with a add-in? I assume there are some framework classes, that can help me on this task but I have no idea which ones that are. Thanks for hints and help on this...
5
2149
by: Agrona | last post by:
I found this thread: http://www.thescripts.com/forum/thread233505.html only marginally helpful. It seems that going through the callstack is the only way to determine which function may have called the function currently being executed. Is this thread-safe, or are there other alternatives (I'm pretty new to reflection; can it do that)? ...
4
3340
by: shirleylouis | last post by:
Hi Ppl, Could anyone help me out with retrieving URL from Clipboard using C#??
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.