Does anyone know of a function to determine the screen resolution of the monitor through code?

AND/OR

Does anyone know how to determine the IP address of your own PC through code?

Thanks,

Sean