Answer Questions
fuongptit-kodomo Difference in allocating memory when static or local
I have a static array of struct that I use in a lot of code. Recently I have found need to try and create this variable with an array size over 27M. I am able to do this, as a test, if I create a local variable, but my code requires that it is static and when I try to create it - I get an OutOfMemory Exception. My machine has 4G ram and can easily hold the array. How might I get around this problem Moon Hi what is the value of recsize it could just be that you are running out of memory, so could you not write the values to disk reclaiming them in memory (and disposing of them) as needed That's 10GB of 40 byte records = 400GB. Clearly, that's not going to work. ...Show All
TalhaAziz How do I force VS2005 to use NET 1.1
I am working on a bunch of code that was written for NET 1.1 and will not work with NET 2.0 due to changes. It is looking like trying to fix the code to work under 2.0 is going to require more time then I have for this project. So the question is how I can force this code to use the 1.1 libraries instead Thx Joshua Baker Now there is no way to do this. YOu can program for .Net 2.0 and/or .Net 3.0 with some extensions insalled but not for .Net framework 1.1. I would recomd you to upgrade your application to .Net 2.0 or use Visual Studio 2003. Best Regards, Hi Joshua, see this thread: http://msdn.microsoft.com/newsgroups/default.aspx &query=vs2005+1.1&lang=en&cr=US&guid=&sloc=en-u ...Show All
DotFrammie best practices to secure c# applications
Hi, I'm starting this thread to hear your experience on the best practices of securing c# applications and code from being reverse engineered and generally jimmied with. Thanks for your input. I think before one can really discuss this topic, you need to clarify what you mean by securing an application. If all you mean is that you don't want someone to reverse engineer the application and reuse your code for their own purposes, thats one thing. If you mean to "secure" it in order to protect the private information that is handled or made available to authorized users through your application, then this becomes an entirely different discussion. I bring this up because, contrary to what man ...Show All
mblas 同 How to use c # to write shrinking algorithm?
Algorithm use c # language is described shrinking Can write the code example thanks Where do the current numbers come from 1: 0,1,9 2: 4,8,4 3: 7,3,3 4: 3,1,3 5: 7,3,6 6: 2,5,5 7: 4,5,9 8: 5,5,8 9: 5,0,4 10: 7,3,5 11: 1,9,3 12: 0,3,5 13: 5,5,0 14: 8,1,4 15: 9,1,6 16: , , Have appeared the numeral through the above 15 groups, calculates 16groups of numbers Each digit is 0-9 random number "Each digit is 0-9 random number"! Do you mean you just want to create random numbers ----------------------------------------- 1: 0,1,9 2: 4,8,4 3: 7,3,3 4: 3,1 ...Show All
Peter Kahn Returning Type[] of inherited types
Does anyone know of a quick and painless way of returning an array of all the inherited Types of a given base class For instance, I have the following: Type myType = typeof(Motors.Motor); Type[] t = myType.GetNestedTypes(); Motor contains many different types of Motors. I understand that GetNestedTypes only returns the classes nested inside of Motor. All I need is a basic method that returns an array of the types which inherit from Motor. I can write this method myself with very little coding, but I figured there had to be something out there that already did this. Thank you many times over for the great explanation, it helped a lot! Even though I'm not very happy about it, at least I understand why I ca ...Show All
LaoZeng HELP - Problems using SendKeys class
Hi, I am developing an application that uses SendKeys to control a game. But the problem is that, till now, of all the games i hav tried, it can work only on BricksFix version 1.62. Can anyone pls tel me y it is not workin on other games. I tried a lot of games, but it is not workin, but wen i try on BricksFix its workin. Also if possible, pls give me a list of games which i can control using SendKeys. Thanx Sendkeys needs the edit box or control...your sending to...to have the focus. You may have to send TABS to the app/game to move to the control and activate it. Hi, thx for replying me.. tat really hav given some idea to me.. then is ther any way to send key strokes to gam ...Show All
Siva116 Accept Button on the form
Hi On your form you can set the accept button property to a button on the form. What does this do If when ever a user presses enter i would like it to press the accept button. Can we programiticaly pres the button Thanks in advance The button on your form you set the AcceptButton property to will be pressed when the user presses Enter. ...Show All
Kesava Assign a bmp resource to a bitmap variable
I create a resource bitmap as bmp. I can not assign this resource bmp to a Bitmap variable. What I would like to do is change or swap between two bmps every second in a picturebox image. thanks in advance for your help and time, Edward ok the problem was that the image was not embedded as a resource. After changing it to be embedded as a resource, everything worked fine. Once embedded, the resource name will be in the format of, generally, : applicationName.filename.ext if its in a folder (1 folder deep): applicationName.folderName.fileName.ext remember, the folder name and filenames are case sensitive if its under a folder called resource, then im not sure if it will still need to ...Show All
Lovericky How to make ToolStrip ComboBox resize when the dialog is resized?
Hey! How can I make the ToolSripComboBox automatically resize when the dialog is resized Matt What code do I add to the resize event Matt C# please. Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize Dim w As Integer = ToolStrip1.Width ToolStripComboBox1.Width = WhatEverStillFitsAndIsAcceptableToTheUser(w) End Sub what do you mean by: WhatEverStillFitsAndIsAcceptableToUser(w); Matt That's your function to write to determine how to fit the toolstrip controls into the available toolstrip width. I'd do something like multiply the ori ...Show All
Speedbird186 Strings
Hi there I am trying to connect to a SQL database, the default installation of SQL Express installed by Visual Studio Professional. Let me first say I'm coming from a VB6 background, so I know diddly squat about C#. You can consider me a classic case of VDU (Very Dumb User). My main problem is that I am trying to connect to the sql server by using a connectionstring. I am setting the value of the connection string as follows ConnecString = @"Data Source=[GD-MOBILE\SQLEXPRESS];Initial Catalog=PRISM_Test;Integrated Security=true" My problem is that the single backslash is converted to 2 backslashes, and I think this is causing the problem. How do I get just one backslash in there Thanks Carlos I ...Show All
kalprin Convert VB to C#
Well, i have tried at least 3 apps, to convert the code, but neither of them worked! VB CODE: For Each queryObj As ManagementObject in searcher.Get() Dim arrVendorSpecific As Byte() = queryObj("VendorSpecific") MsgBox("Temperature = " & arrVendorSpecific(101)) C# CODE: foreach (ManagementObject queryObj in searcher.Get()) { Byte[] arrVendorSpecific = (byte[])(queryObj["VendorSpecific"]); Console.WriteLine("Temperature = " + arrVendorSpecific(101)); } This ir the error i get with the C# code: 'arrVendorSpecific' is a 'variable' but is used like a 'method' ps: the VB code works fine! So falo un pouco de portugues... eu sou de Uruguai. So I'll explain ...Show All
YoungEngineer Trigenometry Woes
Greetings fellow coders, I am having a bit of difficulty with coding some trigonometric functions. The primary goal I have at the moment is to find the two unknown angles in a right-angle triangle of which I know all 3 dimensions. While I know how to do this in theory, finding the code to accomplish this is proving difficult. For example: I have a triangle with a base of 6cms, a height of 5cms and thus a hypotenuse of ~7.81. It is a right-angle triangle and thus one of the three angles is 90 degrees. How can I find the other two angles I can't seem to find a Sin-1 function in C#!!! Please note I am using C#.NET 2003, not 2005. Thank you in advance for any help you can give me. However, this only returns in radian ...Show All
dlcollison Getting the width and height of a docked panel
Hi, I want to get the height and width of a docked panel. Now when I do pnl.Width I get the Width of the panel in design time. Can anybody help me Grtz Annihil8 The heigth, width and Size are all the values from design time. I've noticed that this is also for the form which contains the panel. It is a mdiForm set to to maximized, but the size, height and width are all the values of the mdiForm when windowed. Grtz Try reading the Panels Height property. Another option is to grab the value of its Size property and have both the Height and Width in one easy structure. ...Show All
HowardRichards Printable Version of .NET Class Library
Hi, I am looking for .NET class library with descriptions that can be printed out on paper. MSDN offers a great reference but somehow i have trouble printing it out properly. Can someone please tell me where else i can find something similar thanks very much Ah! Gotcha, thanks for that. If you have MSDN installed on your computer, you can print the pages you like in the help file. I'm not sure there is a paper back version of the entire doc, not AFAIK - everything is online and you have the MSDN documentation too (if you have it installed) Err...he wanted to print out the MSDN library.... what exactly do you need help with the MSDN docs are pretty good at this IMHO, here is a ...Show All
levins Check if string contains valid year
How do I check if a string contains a valid year only... I've the classic way but it seems it works only with complete dates. Here's what I tried: string MyString = "2001"; DateTime MyDateTime = DateTime.Parse(MyString); Console.WriteLine(MyDateTime); This code snippet throws an exception ! Any help would be appreciated. also as long as it does not exceed the DateTime.MaxValue year date - 9999 I think Hi Or you can do like this : try { new DateTime ( int .Parse(MyString) , 1, 1); } catch ( Exception ) { // Invalid year value } Yours Markku My Version: string MyString=" 1776 "; Console.WriteLine(DateTime.ParseE ...Show All
