Well, if you intend on actually connecting to a client behind a firewall, make sure you set up port forwarding for it. As for getting the IP, your only choice is to use a machine outside the local network. Something like make a HTTP query to whatsmyip.com and extract the result.
Broken God
Posts
-
How to get the Internet IP -
Not Quite a Programming QuestionWell, you can use a lot of the .Net library in ASP.Net apps - they're completely normal .Net apps (except they show up on a website, so some things just don't have a way to work (Windows Forms for example)).
-
How to make points well -distributed ?Well, you'll just have to use a well-distributed random number generator to generate coordinate pairs for the points. System.Random should be fine.
-
How to get a point within a circleThis should do it: a = angle r = radius x = cos a * r y = sin a * r
-
Strange TypeLoadExceptionI am using the VS.Net 2005 alpha and I am getting a strange exception. When I try to use the Axiom graphics library, it crashes when it tries to load the Win32InputReader class. After some commenting, I found that the exception does not happen when I comment out the line "private MouseState mouseState;". MouseState is a DirectX type. I am using the Summer 2003 version of DirectX. It compiles fine, but stops when it tries to load that type. What could be causing this? Compiles fine...
-
Ghostride through ChernobylInteresting website. I've always wanted to see some of the place myself. My father was one of those sent to clean the place up. He was one of the guys who washed the radioactive dust off buildings with fire engines (didn't put out any fires, he was shipped in from... 1000-1500km away, so the fires would have been put out by the locals by then - probably why he's still alive and well). He was also ordered to go clean the rooftops manually but he and the guys with him told the bosses to go to hell. Heh, great Soviet discipline probably saved his life ;P
-
TypeInitializationExceptionNamespaces are not types, so that couldn't be it. Try to find the real "Start" type. And when exectly does it give the error?
-
ParentForm and a null referenceAh, I see. The problem is that when you use Form.Show(), it creates a global form, not a child form. You either need to set the Parent property manually (which will also put the second form "into" the first form visually) or create a modal form using Form.ShowDialog().
-
GDI+ ProblemDoes this all happen with the same font?
-
ParentForm and a null referenceWhen are you trying to do this? In the constructor? ParentForm has the default value (null) when in the constructor (just like any other variable).
-
i'm a beginner. helpC:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>csc /? Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4 for Microsoft (R) .NET Framework version 1.1.4322 Copyright (C) Microsoft Corporation 2001-2002. All rights reserved. Visual C# .NET Compiler Options - OUTPUT FILES - /out: Output file name (default: base name of file with main class or first file) /target:exe Build a console executable (default) (Short form: /t:exe) /target:winexe Build a Windows executable (Short form: /t:winexe) /target:library Build a library (Short form: /t:library) /target:module Build a module that can be added to another assembly (Short form: /t:module) /define: Define conditional compilation symbol(s) (Short form: /d) /doc: XML Documentation file to generate - INPUT FILES - /recurse: Include all files in the current directory and subdirectories according to the wildcard specifications /reference: Reference metadata from the specified assembly files (Short form: /r) /addmodule: Link the specified modules into this assembly - RESOURCES - /win32res: Specifies Win32 resource file (.res) /win32icon: Use this icon for the output /resource: Embeds the specified resource (Short form: /res) /linkresource: Links the specified resource to this assembly (Short form: /linkres) - CODE GENERATION - /debug[+|-] Emit debugging information /debug:{full|pdbonly} Specify debugging type ('full' is default, and enables attaching a debugger to a running program) /optimize[+|-] Enable optimizations (Short form: /o) /incremental[+|-] Enable incremental compilation (Short form: /incr) - ERRORS AND WARNINGS - /warnaserror[+|-] Treat warnings as errors /warn: Set warning level (0-4) (Short form: /w) /nowarn: Disable specific warning messages - LANGUAGE - /checked[+|-] Generate overflow checks /unsafe[+|-] Allow 'unsafe' code - MISCELLANEOUS - @ Rea
-
Strange exception in a strange threadOK, thanks for the help. I'll try and see what happens with all exceptions breaking into the debugger on throw.
-
Sending mail using SMTPWell, the from should be an e-mail address.
-
Loading assembliesWell, I did plugin loading by first just listing all the DLL files in the plugins directory and then calling Assembly.Load() (I think that's what it was called) for each of them and specifying the file as the parameter.
-
Strange exception in a strange threadI've started getting a very strange exception in my program. An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module. That happens sometimes when a window is created (not a specific window, has happened with messagebox and my own forms). I am using .Net version 1.1. This is my first app with 1.1, so maybe there was some important detail I missed that has changed from 1.0 to 1.1? I know threads and UI can cause a mess if done badly, but I am not doing any threading at all. It seems that before the exception occurs, a new thread with no name is created. VS cannot tell me anything about the thread: there is no call stack, the stack frame selector is unclickable... nothing.
-
Custom MessageBox buttonsIs it possible to somehow specify the text of the MessageBox buttons? I'd very much like some "Yes to all" and "No to all" options, but the aren't many standard button titles to schoose from :(
-
File masksWell, you could generate a regex out of the mask. Add "^" to the beginning. Add "$" to the end. Replace "*" with ".*". Replace "?" with ".". And that should do it. Although you'll need to escape some characters like "(", "+", "." and "[" and a lot more.
-
Pixel format conversionHow can I convert a bitmap from one format to another. (For example, 256 colour to 24-bit colour)
-
Coding StyleThis is what I do: FunctionsAreLikeThis() PropertiesAreLikeThis ClassesAreLikeThis _PrivateFieldsAreLikeThis variablesinfunctionsarelikethis I do not allow any public fields, just properties. I do not use any prefixes or suffixes, except the private fields one and some with event handling (EventHandler at the end of delegates).