Is there such a thing in C#? I know of the internal class modifier, but I want to grant "friend"-like access to a particular class from a different assembly. The reasons why I need this are long an involved, and the company I work for won't budge on the issue, so I need to find a way to make this work. Any ideas? Thanks.
Quimbly
Posts
-
Equivalent of the C++ "friend" class modifier -
Tricky exception handlingDoes anyone know best practices (i.e. a tried and true method) for this problem? I want to re-attempt an operation which caused on exception, and do so an arbitrary number of times. For example, I want to try connecting to a database multiple times before giving up. I have a solution (in C#), but I suspect it's not the best way to do it : RETRY: try { dbAdapter.Fill(dataSetToFill, statementCriteria.TableName); } catch (System.Data.Odbc.OdbcException dbe) { x++; if (x>max) { throw new DMTException("************** ODBC Error >>>" + x.ToString(), dbe); } else { goto RETRY; } } This seems to work, but I'm using goto, which is never a good idea. Any suggestions?
-
Searching for symbolic math .NET componentI'm working on a behavioral animation project using C#, WinForms, CsGL and NewtonDynamics.NET. What remains is for me to do is find a .NET math component. Behavior of my critters is defined, in relation to other critters, by a mathematical function which returns a scalar value. This value is then used as a scale to determine the degree of force to apply to the critter, resulting in movement towards or away from the other critter. This is a simplification, but I hope you get the idea. The problem is that I'm currently defining these "behavioral functions" in code. Hence, I can't change a behavior of a critter unless I change the code and recompile. What I want is to be able to define or change these mathematical function at run-time. What I'm picturing is a a pop-up window where I can visually and symbolically define or modify a behavioral function at run-time. The function would be a standard math function, returning a double, and making use of basic numeric mathematical operators like: addition, subtraction, powers, roots, trigonometric functions, etc. I could invent a little visual, symbolic math language and write my own interpreter for it, but I'm sure this sort of thing has been done before. Does anyone know of a .NET component that could help me out with this sort of thing? Thanks.
-
Reverse IP Lookup in C#/.NETNo, this is not specific to a Windows network. I need to be able to get the "computer name" of any in-coming IP address to the firewall. Basically, I want my app to be able to do what a NSLOOKUP call does. Get what I mean?
-
Reverse IP Lookup in C#/.NETI'm developing a firewall log monitoring application in C# with the .NET framework, and I can't figure out something. I'm trying to do a reverse lookup on an IP address. I don't mean reverse lookup to a DNS entry. I'm looking to find out the computer-name behind the IP address. The only thing I can find that's remotely related is: Dns.GetHostByName() and Dns.GetHostByAddress(). However,these methods deal with IPHost objects, which only contain DNS or IP information -- nothing about computer- name. Does anyone have any idea how to get a computer-name from an IP address in my C#/.NET application? Is there anything in .NET that will accomplish this? If so, what is it? If not, what can I call outside of .NET that I can incorporate into my application? Thanks!
-
Reverse IP Lookup in C#/.NETI'm developing a firewall log monitoring application in C# with the .NET framework, and I can't figure out something. I'm trying to do a reverse lookup on an IP address. I don't mean reverse lookup to a DNS entry. I'm looking to find out the computer-name behind the IP address. The only thing I can find that's remotely related is: Dns.GetHostByName() and Dns.GetHostByAddress(). However,these methods deal with IPHost objects, which only contain DNS or IP information -- nothing about computer- name. Does anyone have any idea how to get a computer-name from an IP address in my C#/.NET application? Is there anything in .NET that will accomplish this? If so, what is it? If not, what can I call outside of .NET that I can incorporate into my application? Thanks!