624 Posted Topics

Member Avatar for kavi4u

[QUOTE=thines01;1704880]You can store your connection string in a dll and link it to your program. You would only need to change your main program if the database brand changes.[/QUOTE] Why a dll? A registry entry or a config file (xml or ini) would be more robust. This way, a human …

Member Avatar for thines01
0
189
Member Avatar for Srcee

Strategy games (or 3d games if you have patience and artistic talent) are always good learning exercises. Once you have the game built, creating an AI that can beat you is the next learning step. Chess comes to mind... (Although C# isn't exactly the ideal language for AI programming - …

Member Avatar for berniefitz
0
192
Member Avatar for ameera123

If the document is encrypted already, I don't really see the point in sending it with SSL.

Member Avatar for hericles
0
113
Member Avatar for Kobrakai

That XML seems a bit flawed. The way it's set up there can really only be 1 application added. [code=xml] <root> <software> <software_entry name="My Program" path="C:\MyPath\" type="msi">My Program</software_entry> <software_entry name="My Program2" path="C:\MyPath2\" type="msi">My Program 2</software_entry> </software> </root> [/code] Makes more sense to me. Although I'll admit I tend to abuse …

Member Avatar for Kobrakai
0
163
Member Avatar for Enrique Nivasch

If you want the second namespace to know about form1, you need to reference it with a using statement at the top of the code. Then instead of having a generic object member, it can be of type Form1, and this should solve your problem of not being able to …

Member Avatar for Antenka
0
232
Member Avatar for alaa sam

[QUOTE=alaa sam;1704037]what I want is to show another form within the same application I will try what you suggested thank a lot I really appreciate it[/QUOTE] As in an MDI form?

Member Avatar for ChrisHunter
0
89
Member Avatar for Marucss

People here will not do your homework for you. Especially if you just copy and pasted it from an assignment. At least put in the the effort to make it seem like it's you asking the question and not a prof.

Member Avatar for skatamatic
0
107
Member Avatar for mxa92

[QUOTE=gusano79;1698972]If you want to check for collisions between munchies, one way to do it is to use two loops, along these lines: [CODE]for(int i = 0; i < noOfMunchies - 1; i++) { for(int j = i; j < noOfMunchies; j++) { // Check for collision between munchies i and …

Member Avatar for gusano79
0
391
Member Avatar for haanjae

For computer name: [icode]Dns.GetHostEntry(stringIP).HostName[/icode] should work. For the ip, I've used this before: [code] string sIP = (mySocket.RemoteEndPoint.ToString().Split(':'))[0]; IPAddress tempIP = IPAddress.Parse(sIP); [/code] This will seperate the port number from the IP in the RemoteEndPoint, then will parse this as an IP address. Though there might be a better way …

Member Avatar for haanjae
0
1K
Member Avatar for Murugavel B

In the new C# you can make fields into automatic properties, and apply public/private/protected/internal/etc accessors to them: [code] int myInt { public get; protected set; } [/code] Pretty sweet imo. Really not sure how much overhead is involved in doing this though...

Member Avatar for skatamatic
0
111
Member Avatar for farshadak2004

Spying on other processes is not very trivial. I think Microsoft did this on purpose to make writing malicious code not all that easy to do. I am not overly familiar with the API's you are talking about, but suspect they come from the USER32.dll library. Though I strongly suspect …

Member Avatar for skatamatic
0
314
Member Avatar for skatamatic

My boss asked me to write a PID class to control a motor today. No big deal, except that the deadline is tommorow evening. My calculus is rusty, and my vb6 is probably worse (which is the language I am to use). Anyone have a good understanding of a PID …

Member Avatar for skatamatic
0
2K
Member Avatar for phorce

To avoid unexpected results, it helps to cast all variables to a common datatype prior to performing calculations: [code] double percentage[] = new double[1]; percentage[0] = Math.Round (((double)analysis[i] * 100d) / (double)char_count); [/code] Furthermore, it makes more sense to only perform rounding as the last step - such as displaying …

Member Avatar for thines01
0
97
Member Avatar for skatamatic

I am just wondering if anyone has any pointers on how to index my database. It's for a piece of instrumentation software that loads in large amounts of sensor data (sometimes over 3 days worth of recording at 1 second intervals for 90 sensor's doubles). Right now it can load …

Member Avatar for skatamatic
0
126
Member Avatar for walid86

Hate to revive an old thread, but this might be of value to the OP: [code] string myPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); [/code] If you use this instead of a hardcoded path to your files it won't matter if the actual path changes between computers. It's worthwile to make yourself familiar with …

Member Avatar for skatamatic
0
176
Member Avatar for vincezed

Explicit Casting: [code] try { Control myControl = (Control)myObject; } catch { //Object did not conform to Control class...Do something about it. } [/code]

Member Avatar for skatamatic
0
131
Member Avatar for skatamatic

I am trying to write a somewhat generic class for calculating rolling averages. It's generic in the sense that it needs to support all numeric datatypes (int, double, short and long). I'm a bit of a noobie to VB.Net and have run into a problem: [code] Public Class RollingAverage(Of T) …

Member Avatar for lolafuertes
0
170
Member Avatar for Tortura

Sounds like you should look into multithreading. Running the UI on one thread and the background work on one or more threads is fairly common practice these days.

Member Avatar for Tortura
0
223
Member Avatar for lxXTaCoXxl

One simple way to keep track of which forms are loaded would be to have a call in their On_Load events to increment a variable in a static class. If you know the total number of forms to load, you can use this number to evaluate the percent loaded. Keep …

Member Avatar for lxXTaCoXxl
0
114
Member Avatar for Asotop

Well this really depends - will it always accept input in EXACTLY this form: (constant+/-constant*j)*(constant+/-constant*j) ? If this is the case, you won't need to get too fancy. If you want it to parse ANY equation that is a different story.

Member Avatar for gusano79
0
165
Member Avatar for drewos

There is a class (I think it is under System.SerialPort but I could be wrong) that has events which fire when data is received. All the nasty work already done for you. (Although there ARE a few problems with the class that I have notice)

Member Avatar for ohammad reza as
0
496
Member Avatar for flagstar

Me and my two roomates rock the shit out of DotA! We usually win too because other people have to type to talk to their team and we can just talk to eachother :P It's pretty much the only game I play though...too much work to do!

Member Avatar for jwenting
2
1K
Member Avatar for Egypt Pharaoh

Look into encryption. There's TONS of material available for it (probably more than most other programming subjects).

Member Avatar for skatamatic
0
57
Member Avatar for Taximus

Sounds like [URL="http://www.codeproject.com/KB/cs/csharpintro01.aspx"]polymorphism and base class inheritance[/URL] may be your friend here, although using interfaces is just as valid. If you need any help with these concepts, post your specific questions here =)

Member Avatar for skatamatic
0
289
Member Avatar for rainonrooftop

What do you mean by bounce? The simplest form of making a ball bounce would be to invert the x or y speed each time it hits an edge (x for vertical collision, y for horizontal). For example: Ball moving at 2 x pixels per tick and 5 y pixels …

Member Avatar for skatamatic
0
110
Member Avatar for pyro 214

I would be seriously choked if I only got 60k a year. I am pretty sure that's what labourers make that dropped out of highschool. I live in Canada but I am pretty sure technology fields pay about the same between us and the US though we have no technology …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for ddanbe
Member Avatar for ddanbe
0
414
Member Avatar for johnnyboyslim

Those are overloaded binary operators. Basically you are specifying what myClass1 > myClass2 really means. For example, say you had a class that contains 2 integers, a and b. If you wanted to implement some functionality that compared the two classes (for example a greater than > operator) your computer …

Member Avatar for johnnyboyslim
0
108
Member Avatar for Behseini

I've used this snippet before: [code] private void Form1_Load(object sender, EventArgs e) { //Hide our form from user this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.TransparencyKey = Color.FromKnownColor(KnownColor.Control); this.Update(); } [/code] Who the hell knows why microsoft decided that by default forms dont support a transparent back color...

Member Avatar for skatamatic
0
6K
Member Avatar for skydivekrazy

[URL="http://www.codeproject.com"]This [/URL] site has some good tutorials and examples to learn from. Chances are you will be learning to write console apps before you learn to write windows apps, althought it seems like you won't be able to write that (very easily) in a console app.

Member Avatar for skatamatic
0
197
Member Avatar for TylerVo
Member Avatar for Dmennite

Hmmm it may be possible that you have multiple radio boxes subscribing to this event (I suspect there are 2). If that is the case, when you click a radio button it will fire the event since the button's checked value will change. But the nature of a radio button …

Member Avatar for Dmennite
0
153
Member Avatar for lxXTaCoXxl

If you solve this problem - you will be a rich man. Just look at licensing for games. There has yet to be one method of this type of security that hasn't been broken. (Although online validation seems to be pretty solid) The MAC you grabbed is probably the first …

Member Avatar for skatamatic
0
117
Member Avatar for bettybarnes

[QUOTE=bettybarnes;1672286]Thanks for the replies.. How about if i wanted to delete the last text input in the textbox say for example the characters inside the textbox is: LATER. I want to remove the last letter R. How will i do this in C#?[/QUOTE] Think about how you would do it …

Member Avatar for Mitja Bonca
0
187
Member Avatar for albana
Member Avatar for ChrisHunter
0
111
Member Avatar for praveendasika

That is an explicit cast. Basically you are forcing the cpu to consider the control that is found on the grid to be a textbox. This is because the FindControl() function returns an object of type Control. A textbox is derived from a Control so the cast works, and is …

Member Avatar for skatamatic
0
102
Member Avatar for anhtanh95

Windows doesn't like the win32 api RemoteThread() call anymore. But as far as getting 'winject.exe' to work - it probably needs some command line arguments, as you are in no way specifying the dll to inject. Check the documentation. Also, don't cheat in online games (unless you are just trying …

Member Avatar for skatamatic
0
244
Member Avatar for RenanLazarotto

[URL="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx"]Regex[/URL] would work great for that. But really - there shouldn't be any other files starting with 'host' in that folder so it may be overkill.

Member Avatar for RenanLazarotto
0
134
Member Avatar for zifina

[CODE]if value > trackbar.maximum then trackbar.value = trackbar.maximum[/CODE] It's pseudocode, but should do the trick.

Member Avatar for zifina
0
96
Member Avatar for sachintha81

Sorry if this doesn't help solve the problem, but why exactly are you using this ID schema?

Member Avatar for sachintha81
0
199
Member Avatar for 07-0466

Books are [B]definately not[/B] the fastest way to learn a programming language (unless you read extremely fast). I have a 700 page C++ book that only teaches up to polymorphism. You need 2 more 700+ page books to learn STL, templates, windows api, etc. Are you familiar with any other …

Member Avatar for 07-0466
0
117
Member Avatar for nav07

The COM interop for excel is REALLY crappy for some reason. I wrote a class that loads in at max 100x100 grid. Takes about 45 seconds to load it...... I didn't use OLE, I used the interop, but I suspect they are similarly bad. You can try using the COM …

Member Avatar for skatamatic
0
465
Member Avatar for maximchris

Yes. You will need to look into [URL="http://www.marten-online.com/csharp/simple-custom-event-handling.html"]event programming[/URL] though. I suspect you are using a Direct3D environment - if this is the case you may want to set up an on-click event for the 3D area, then inside that event use Ketsuekiame's method of finding which object was clicked …

Member Avatar for skatamatic
0
184
Member Avatar for aan160

Networking is, in my humble opinion, boring as hell! You will understand when you finish subnetting your 500th network or setting up a huge stack of cisco switches only to be avoided in the coffee room at lunch time because your just the network room 'geek'. Not to mention the …

Member Avatar for innocentlogic
0
198
Member Avatar for WolfShield

From what I remember C++ was a good time. But C# blows it out of the water if you like getting your work done in time for beers and the hockey game.

Member Avatar for Netcode
0
1K
Member Avatar for sowdust

Here's some code I wrote to get data from an excel file... To add the reference go to Project->Add Reference then find Microsoft.Office.Interop.Excel under the .Net tab. Note I think you need to have excel (or maybe just any office product) installed in order for this reference to be available. …

Member Avatar for skatamatic
0
264
Member Avatar for techlawsam

You are missing 2 closing curly braces at the end. One should close the class, the other should close the namespace.

Member Avatar for arunkumars
0
559
Member Avatar for debraph

How do analog phone lines know when someone has picked up? Seeing as they only use 2 wires (sig and ground) there are no control signals for things like picking up a phone. I suppose it can be determined based on the frequency (if the prominent frequency does not conform …

Member Avatar for debraph
0
344
Member Avatar for Valten1992

On line 84: Thread.Sleep(1000) will likely be causing the lag. Every time you paint the form you pause the thread for a whole second. What is the reason behind this? Also, you shouldn't need a refresh() in the target() method.

Member Avatar for Valten1992
0
114
Member Avatar for SyncMaster170

Well, are you storing the user data in a class of any sort? Or is it being loaded directly from a database to the datagrid? What does FindMember() do? I would think that it finds a member...so could you not use that do determine if the member already exists (ie …

Member Avatar for Mitja Bonca
0
129

The End.