
Nerseus
*Experts*
-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
Check out this FAQ. The link points to the Textbox portion. DiverDan has it half right - you want to disable the context menu. You'll also need to trap for keyboard to prevent Ctrl-C. It's in the FAQ (I think it's Ctrl-V for paste, but you can get it). -Nerseus
-
Port 80 is the default for HTTP requests. If you can reach the webservice from outside their internal network, then they are allowing port 80 communications. WebServices are meant to be accessed via standard http or https so putting them on another port would only make it harder for programmers. Moving them to port 10000 isn't making the webservice secure (there is NO security in just "hiding" or obfuscating something). At best, you'll keep simple hacker-wannabees from finding it but that's about all. If you want security, you'll need to use https. Back to your problem. If you can reach the webservice from a browser but not from your app on the same machine, then I'm not sure what the problem is. It's almost definitely NOT blocking of any ports. Is your webservice address hard-coded or are you reading from a config file? As a side note, if you really wanted to use another port, you could put it in the address line. For example, if microsoft moved to port 8010, you could use: http://www.microsoft.com:8010/msdn -Nerseus
-
I wouldn't use the Rnd() function anymore. It's another holdover from VB6 that's been replaced by the FAR better Random object. Dim i As Int32 Dim r As Random = New Random() For i = 0 To 99 System.Diagnostics.Debug.WriteLine(i & " " & r.Next(0, 10)) Next There are other overloads for the Next method. There are also other methods (NextDouble and NextBytes). You'll still have to add 1 to the Max just as before. So for a range of numbers 0-9, use .Next(0, 10). -Nerseus
-
Did you want to stay in Australia? If the training houses are right and .NET isn't taking off in Australia yet, then you might be out of a job if you stick with a .NET focused career. Something to keep in mind. On the other hand, many companies will pay for training, assuming it's not too expensive and if they'll be getting something out of it. You could always mention this to your boss and ask for some cheaper training, such as books, learning CD's or Videos, or cheaper classes. It might require more work on your part, including more of your free time, but then you can keep your job (which you didn't mention if you liked or hated - a big factor in how long you want to stay) and get your .NET training. If the boss won't pay for it, you can always buy cheap books and training yourself. I'd hope that at $60k a year you can afford a few hundred dollars to help your own education. Finding free time might be harder :) Obviously, there is no right answer that any one of us could give you. You're old enough to make this decision on your own with a modicum of advice. -Nerseus
-
You could use "[\S\W]" for non-whitespace and non-word (alpha+numeric). If you want 0 or more to match, use "[\S\W]*". If you want to match at least one but maybe many more, use "[\S\W]+". If you want to match 1 to 10, use "[\S\W]{1,10}". For the record, "*" is short for "{0,} and "+" is short for "{1,}". If you want any specific number of characters, you can put them in curly braces (or use a range like 2,5). -Ner
-
There are links at the top of this page to navigate to any level of the forums. Click the "Extreme .NET Forums" link in the upper left. -ner
-
If you fork out the big bucks for an MSDN subscription, you can download it (been using it for over a week now). :) -Nerseus
-
I think there's only one or two books out for DX9 right now, not much of a choice if you really want a book. I'd start by creating a project from the New Project wizard. It creates a Direct3D project with a TON of source code. I'd look through there, should take a few weeks to get a good feel for it if you really look at what's going on and look up the functions in the help file. It's a start anyway. -ner
-
I don't think so. \W by itself says match anything *except* digits and lower/upper case characters (and maybe underscore). By using \W you don't need to also use \D, it's redundant. I have no idea what you're doing with the & character... if you're trying to do "this AND this", you don't need the ampersand, that's more of C# syntax. I think all you want/need is: @"[\W]*(?<F>" + find + ")[\W]*" This says match 0 or more non-letters and non-digits right next to your "find" letters. Then find 0 or more non-letters and non-digits on the right hand side. So: ".joe." will match "#$%(*(joe@$^" will match "joe" will match "joejoe" will not match ".joe" will match "joe." will match "ajoe" will not match "joea" will not match This is all a guess - I'm not testing any of this :) -Ner
-
The IDE is much slower than previous. Same was true for VB4 when it came out - compared to VB3 it was a DOG! I used to run a PIII 700 with 256meg RAM for VS 2002 (1.0) and some large apps took awhile to load (lots of DLLs, lots of webservice calls, lots of validation, etc. etc. etc.). Some performance testing fixed some programming problems, the rest were all gone when we went to Release mode. Before jumping to any conclusions, compile your app in Release mode and try it out on a typical end-user machine to see what they'll experience. The Debug mode inside of Visual Studio is a great tool for debugging, not so good for performance. -Nerseus
-
Check out this FAQ. I didn't check if your question is there, but it answers a TON of questions on the grid. -Nerseus
-
quwiltw is right, the basic .NET DataGrid does not support it. I thought I heard of a company that wrote a new version of the .NET DataGrid (all in .NET code) that allowed this, but I don't remember the company or the link. I think your best bet might be to go with a 3rd party control. If you want to use two separate grids (or just stick with the basic DataGrid), check out this superb FAQ. -Nerseus
-
I forgot to mention an important fact: When you add the reference to a web reference, .NET builds a proxy class for you. To see the source code (in case you want/need to make changes), you'll have to click on the "Show All Files" toolbar button in Solution Explorer. Then expand the following: Web References ->[i]WebServiceName[/i] ->Reference.map ->Reference.cs It's the Reference.cs file that you want. It exposes all of the webservice methods as actual objects. It generates all of the messy SOAP code to instantiate and call a webservice. Why is this important? Well, it could be important if your webservice returns a non-standard type, such as a class you've created yourself. Even if the type is referenced on the server and client, the proxy class will generate a new class definition. While it may look exactly like your local class, it's technically a different class (in a different namespace). This may not affect you, but worth mentioning. Also, if you ever get an error when calling a webservice, you're likely to see the green highlighted line in the proxy class, not in your "real" code. You may not know that this proxy class exists, so I mention it :) -Nerseus
-
As divil pointed out, an XML file can easily be copied with rest of your application. Using the registry would require an admistrator to go the registry to make any configuration changes. If we're talking about a server-deployed solution, an XML file is WAY easier to manage versus the registry. Also, .NET was made to read configuration information from a config file. Ever notice the "(DynamicProperties)" property on every control? And to extend Derek's point, writing to the registry may require priveleges that you don't want your application to have. Whereas reading an XML file from the current directory is pretty much a given for any application. -Nerseus
-
Do you get ANY help when you click on Visual Studio's Help menu? Maybe you skipped the step of the .NET install that installs the MSDN library of help, usually on a separate CD (or 3 in my case) or DVD from the Visual Studio/.NET files. -Ner
-
1. Why is the * quantifyer placed before the grouping? The * indicates that the previous character(s) should repeat 0 or more times. If you have the expression: a[c]*d it would match (0 or more of the character 'c'): ad acd accd acccd You could use the expression: a[cd]*e to match 0 or more of either the character 'c' or 'd'. The following would match: ae ace ade acce adde acde accddccdce The + is used to indicate 1 or more. So if the expression were "a[c]+" then "ad" would not match, but "ac", "acc", and "accc" would match. 2. The question mark? The question mark, where I put it, is part of the Grouping syntax. You make a group like this: (?<MatchName>expression to match) 3. Why is the grouping end parethese placed inside the start of the 2nd set of special characters? Look at 2. above. The ending paren is just part of the group name and must come after the regular expression that represents what the group should be. Essentionally you're trying to find a word (just a set of characters in a particular order) and assign that word to a group name. So if you're looking for the word "Item", the group name should look like: (?<MatchName>Item) If you wanted to make it more generic, you could use any regular expression syntax in place of "Item", such as [\w]+, which would find one or more letters or numbers. Here's the new group: (?<MatchName>[\w]+) I find MS's help on regular expression VERY thorough, though you may have to jump through a number of links in the help to find a good sample of what you need. I'd use the help's search option for regular expression examples. The normal F1-linked help from Visual Studio will show mostly the Regex object help and I can never remember which links to click to get to the "good stuff". -Nerseus
-
1. Yes, DirectDraw in DX9 is the "same" as it was in DX7. While you'll obviously have to port the code from VB6 to VB.NET, the DX functions names should *mostly* be the same. 2. There are MANY ways to store map data. If you wanted to easily load and save a map, I'd stick with plain text for now. The idea of using numbers to represent tiles can easily be extended to include letters. For example: Map File - assume 1 is a wall, 2 is grass: 111111 122221 121121 122221 111111 From the above, you could easily use a combination of letters AND numbers - between lower/upper case and digits, you would have (quick math in head...) 62 tile types. If you went with binary you could get 255 but it's more of a headache for this early stage of your game. If you design it right, loading a map should have no impact on the game. Meaning, you can easily change how map files are stored/loaded without affecting everything else in the game. 3. There's at least one book that covers isometric programming. I would guess that you would need some extra "z" type information stored with each tile in order to know when to draw it (in front of a player or not). For the record, amateur programmers don't start with an RPG - they start with Tic-Tac-Toe or Connect Four, then move on to a card game (maybe blackjack), then a simple 2D game like pacman, then move onto more difficult projects. Well, I should say smart amateur programmers don't jump right into an RPG :) 4. Why is everyone worried about faster all the time? Anyway... I would use whatever is easier to understand for now. If that means a timer, then use one. If you've already got the know-how to create a game loop inside of an event-driven programming model (like .NET), then you can use your own timing-based code to animate the sprites. Regardless of whether you choose a timer or if you have a game loop that gets the elapsed time, I'd suggest using one bitmap with all the images. Just my preference - using separate bitmaps won't have much affect on performance unless you load every single tile as a separate DirectDraw surface (that could consume extra memory - but only potentially). <mindless_blather, only read/pay attention if you want> Since you're just beginning, I'd make the following suggestion: Do NOT confuse your sample code with a game. Keep your samples simple - you've got one that loads a sprite and has it move on a right click. Don't think you can expand on that program to add tiles, then add score, then add a "player" class, etc. etc. and you'll eventually end up with a game. A game is MUCH more work than it first seems and it's better to start with a good idea of what data needs to be stored, in what objects, etc. Once you've got the samples working right, start a new project and design your game - you can always copy code snippets that work into the final game. But if you just keep expanding on one program, you're bound to end up re-writing a LOT more than if you'd just started fresh. </mindless_blather> -Nerseus
-
Have you tried adding the EndEdit code I mentioned above? I think it will solve your problem. -Nerseus
-
You'll first need to add a webreference. In your project, right click on the References node (in the Solution Explorer) and select Add Web Reference. In the popup, put in your URL and press enter, then Add. You should now see your webreference in your project. I'd suggest renaming it - the default name is the base URL (so if the webservice is at http://www.microsoft.com/link then the name will be "www.microsoft.com"). Name it something like "MyWebService" or whatever makes sense. Now in code, you can instantiate the webservice like any object, as in: Dim ws As MyWebService = New MyWebService() Dim ds As DataSet = ws.GetMyDataSet() Now you're dataset is filled, no need to use a DataAdapter. -Nerseus
-
I think you're going to want to use Groups with the regular expression. The problem is that a Regular expression by itself just tells you whether or not there's a match, and optionally returns a list of matches. Since you really want to find a match based on delimiters, you need a way to specify which parts of the match you want. Here's a new expression that includes a group name of MyMatch. It's the same expression as yours, but instead of just inserting your "find" string in the middle, I've put it inside of the named group, MyMatch. The for loop then loops through matches and pulls out the Group by name. MatchCollection mc = Regex.Matches(text, @"[\s\.\<\>\?\\\!\*\(\)\/\-\+\=]*(?<MyMatch>" + find + @")[\s\.\<\>\?\\\!\*\(\)\/\-\+\=]"); foreach(Match m in mc) Debug.WriteLine(m.Groups["MyMatch"].Value); -Nerseus
-
Actually, I've added properties to inherited controls and they show up automatically in the properties window (A bool property has the usual True/False choices). Just make sure your property is public. -ner
-
I've seen the same behavior as you. Meaning, a DefaultView is not the ONLY view into the table, just a default GridView in case you want one. I use a grid by DevExpress and it has a similar problem. For it, I can bind the parent table to a specific table or a view, including ds.Tables[0].DefaultView, and it respects the filtering of the DefaultView even if I chance the RowFilter later in code. Unfortunately, in the grid I use, there's no way to get child tables to filter. Maybe try setting the grid's DataSource to the DefaultView property? -ner
-
There's a problem in .NET where the Form Designer won't show your inherited form if it's inheriting from an abstract class. For now, you can use "#if DEBUG" (in C#) to change the declaration of the class, as in: #if DEBUG public class MyBaseForm : Form #else public abstract class MyBaseForm : Form #endif -Nerseus
-
Putting a new datatable from VB to Access
Nerseus
replied to Sibs's topic in Database / XML / Reporting
It sounds like you want to actually create a table that doesn't exist? You'll have to run a query that creates the table, such as "CREATE TABLE table1 (column1 int, column2 int)". I don't know the syntax for doing this in Access, you'll have to check the help. It's definitely NOT as simple as creating a table in code in a DataSet and having some built-in .NET objects create that table in Access for you. You'll have to run a script (the name for an SQL "query" that doesn't really query the database, but instead performs some action) as shown above. -ner -
easy way for list.selected to string?
Nerseus
replied to archer_coal's topic in Database / XML / Reporting
Try ListBox1.Text instead of ListBox1.SelectedItem or (maybe this will work?) use ListBox1.SelectedItem.ToString(). SelectedItem returns an object of whatever type you have in there. Since you're binding, it's an object that represents the data in the database. To convert the object to a string, you can use ToString (as I showed above) or even easier, use the string that's displayed in the ListBox, which is the Text property (also shown above). -ner