|
Hi everyone,
Does anyone know how i can retrieve the IP address of the host PC, and then compare that IP Address with a list of IP Address which is stored in a MS Access database to verify that the host PC is able to view the webpage. I need to do this in C# language.
thank you.
|
|
|
|
|
That may not work very well when the client uses DHCP.
|
|
|
|
|
currently, i am already able to retrieve the ip address of the host PC. right now, i just need to compare it with a list of IP Addresses in my database to search for a matching IP Address. then, if that IP Address is valid, i would allow the user to view the webpage. I am unsure of how this could be done? does anyone have any idea to guide me through?
thank you!
|
|
|
|
|
But the IP address of a system a valid user is using may change. Tracking IP addresses is generally not a very reliable technique and not worth the trouble.
|
|
|
|
|
hello!
i must tell you from the beginning that i am a C# newbie so please bare with me...
i just started learning C# a month or so ago so i am just at the beginning of (what seems to be) a very interesting journey.
my current project demands that i kill any process specified by the user.
i already finished the first part of the program:
the user inputs the name of the program,actually the process, and then clicks the "terminate" button.
the program takes the name and kills the process with the same given name. it shows the "success" message in a text box if anything is OK or shows a message box if some specified errors occur.
now all that works for any ordinary process, the process gets killed, no questions asked!
but
what about protected processes???
i tried to kill my AV process (i use AVAST free, up-to-date version) and it catches a "protected process" error...
the fact is that this error may occur in different cases,even spywares use certain methods to ensure that killing their program is impossible...
now,my obvious question is: how to bypass the process protection and kill those pesky,protected processes??
i have two guesses:
1) there may be some sort of special privileged mode to call the kill function in C# like some special administrator or something
or
2) (here i need serious help as i am a total noob at this part: ) there may be a way to add some info to some windows registry files (if that's what they're called) so that every time windows boots up and starts loading programs,my prog will start up first and block the others from booting up or even deletes the process' sources. Of course,this has to be done entirely by my C# code and i know that a noob like me messing up with window's components' codes may really F**K up the OS for good ...
that's why i really need help...
thanx a lot in advance!
ps: i now see that what i am referring to is a SYSTEM -driven process.
so yes, can you tell me how to kill a SYSTEM process using C#??
modified on Friday, February 19, 2010 10:52 AM
|
|
|
|
|
andyxfun wrote: but
what about protected processes???
Simple. You cannot kill them. System processes cannot be killed by normal or even admin users.
andyxfun wrote: ,even spywares use certain methods to ensure that killing their program is impossible...
A user that picks up a spyware, in most cases probably (in all cases that I know about) also cannot CREATE a process that cannot be killed.
|
|
|
|
|
I need a new class that will build string and each element will link to the next node. I believe this is done using a linklist, but I am having trouble and need some guidance. So far I have
Class ListNode
{
string x;
ListNode Next;
}
Class List
{
ListNode First;
}
Any help would be excellent
|
|
|
|
|
Why re-invent the wheel?
Why not use List<MyClassThatHoldsAString> instead - it handles all the list next, previous,. etc for you.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
List or dictionary would be a simple solution but unfortunately, I need to use the other classes. I can't figure out the implementation of the class using a List<t> in combination with the other classmodified on Friday, February 19, 2010 11:22 AM
|
|
|
|
|
joejack222 wrote: List or dictionary would be a simple solution but unfortunately, I need to use the other classes.
Make sure that it's worth the effort; the prebuilt classes are well-documented (meaning that they're easier to learn) and are used by lots of people (meaning that they're used in lots of conditions, and probably contain very little bugs).
joejack222 wrote: I can't figure out the implementation of the class using a List in combination with the other class
For your entertainment, your Linked List works on my system. I've only changed the names of your classes, and added some testcode;
class MyListNode
{
public string x;
public MyListNode Next;
}
class MyList
{
public MyListNode First;
}
class Program
{
public static void Main(string[] args)
{
MyList myList = new MyList();
myList.First = new MyListNode() {x="Hello"};
myList.First.Next = new MyListNode() {x="World"};
myList.First.Next.Next = new MyListNode() {x="from"};
myList.First.Next.Next.Next = new MyListNode() {x="CodeProject"};
MyListNode currentNode = myList.First;
while (currentNode != null) {
Console.WriteLine(currentNode.x);
currentNode = currentNode.Next;
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
} Where are you having trouble?I are Troll
|
|
|
|
|
More information is required.
|
|
|
|
|
I want to implement 6 strings using a linkedlist. eventually want to make it bidirectional
|
|
|
|
|
I need to create 150 variable names. They must be like "varName01" , "varName01" all the way to 150. How do I do this using a for or while loop?
thanks!
Sundeep
|
|
|
|
|
There is never a technical need for this sort of thing. Consider using a Hash Table or an Array or a Stack or a Queue or another more appropriate data structure.
|
|
|
|
|
What are you doing with them anyway? Magic with Reflection.Emit ?
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:44am.
|
|
|
|
|
What if its an array of objects?
class[] object = new class();?
|
|
|
|
|
sundeepan wrote: What if its an array of objects?
Nothing, no problem
|
|
|
|
|
heh, cool..so now i'm stuck at how to return all the elements of an array at the end of a method
I cant do
for(int i = 0; i < 20; i++)
{
return arrayOfObjects[i];
}
I will have unreachable code.
|
|
|
|
|
return will jump out of the method. What are you trying to do?
|
|
|
|
|
I am trying to return an array...but I cant do
return objectArray;
the compiler error:
Error 1 Cannot implicitly convert type 'Interactive.Geo.WellLog.Track.cgStackedTrack[]' to 'Interactive.Geo.WellLog.Track.cgStackedTrack' C:\Program Files\INT\Net\3.0.3693.0\Tutorials\WellLog.NET\StackedTrackTutorial\StackedTrackTutorial.cs 177 20 StackedTrackTutorial
|
|
|
|
|
Check definition of method - should return cgStackedTrack[] if you want to do this
|
|
|
|
|
Hey thanks!
I think I fixed it. Sorry for the stupid question...
|
|
|
|
|
Well obviously if you first say you're going return something of type T and then decide to return a T[] instead, that wouldn't work. Can you change the method signature, or is it fixed in some way?
|
|
|
|
|
Soooooo how did you think you were going to return the values of 150 different variables??
|
|
|
|