Skip to content

C#

C# discussions

This category can be followed from the open social web via the handle c-065f1d12@forum.codeproject.com

93.7k Topics 383.1k Posts
  • C# ?

    question csharp c++ java delphi
    6
    0 Votes
    6 Posts
    0 Views
    J
    It never hurts to expand your skill set, one thing I liked to do was take problems given in uni and try to work them into my programming. In my Introduction to Error Correcting Codes class I wrote a program in C# to find the coset leaders for a given problem (64 possible cosets i had to find 63 vectors in the set, 256 or 512 vectors total). Good Luck, James Sonork ID: 100.11138 - Hasaki "Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. :-D" - Michael P Butler Jan. 18, 2002
  • windows service

    csharp help question announcement
    2
    0 Votes
    2 Posts
    0 Views
    O
    Hello all, I finally found out what the problem is. I am sharing my views with you. "When you install a service and if your service's Account property is set to LocalSystem, then you need to have Administrator privilege (for the local system) to start the service. So if you have an NT user account and trying to start a service, make sure that you have local Admin privilege set to that NT user account on the machine that you are testing". For further details on how to do it... send mails to me... omkamal
  • Printing using a data reader

    database help question
    2
    0 Votes
    2 Posts
    2 Views
    J
    Pull the data into a DataSet, then use the DataSet while printing, keeping track of which records have been printed. This is beneficial two fold, first you are closing your connection to the database sooner, and second you can make use of the DataSet elsewhere as well (Print Preview). James Sonork ID: 100.11138 - Hasaki "Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. :-D" - Michael P Butler Jan. 18, 2002
  • Interface arrays

    data-structures question
    2
    0 Votes
    2 Posts
    0 Views
    P
    It works fine on my RC1 machine. namespace Test { public interface ITest { int GetTest(); } public class EntryPoint { public static void Main() { // Compiles fine--haven't actually run it... ITest\[\] test = new ITest\[3\]; } } } -- Peter Stephens
  • installutil.exe

    csharp dotnet visual-studio beta-testing help
    2
    0 Votes
    2 Posts
    0 Views
    J
    You'll have to recompile your code with the final version (1.0) of the SDK (all 120 MB of it). Before you can use it on a 1.0 machine. Versions after 1.0 should have to problem handling 1.0 code however (so you won't go through this again when 2.0 comes out). HTH, James Sonork ID: 100.11138 - Hasaki "Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. :-D" - Michael P Butler Jan. 18, 2002
  • Checking for the public key on a assembly

    tutorial
    2
    0 Votes
    2 Posts
    0 Views
    J
    This is untested code, but it follows the example shown at ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemReflectionAssemblyNameClassGetPublicKeyTopic.htm. using System.Reflection; public byte[] GetPublicKey(string assemblyFilename) { AssemblyName assemblyName = AssemblyName.GetAssemblyName(assemblyFilename); return assemblyName.GetPublicKey(); // For the token you can use // return assemblyName.GetPublicKeyToken(); } Sorry for the bad formatting, it appears that the pre tag isn't being very pre like :) HTH, James Sonork ID: 100.11138 - Hasaki "Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. :-D" - Michael P Butler Jan. 18, 2002
  • Please tell me why

    help question
    3
    0 Votes
    3 Posts
    1 Views
    L
    I CANT BELIVE THAT!!! how did i miss that
  • template classes??????

    csharp linux question
    6
    0 Votes
    6 Posts
    0 Views
    L
    No, you can't. The next version of the CLR will support template classes, and so will be available to all languages that want to support it, not just c#
  • 0 Votes
    3 Posts
    1 Views
    K
    That really helps me! Thank you. Kyle
  • lParam to LPNMHDR

    question csharp help
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Printing, wrapping text, pagination, etc.

    question
    5
    0 Votes
    5 Posts
    0 Views
    K
    Here's the code: // Reference InteropServices; using System.Runtime.InteropServices; // define constants for the physical offset values private const int PHYSICALOFFSETX = 112; private const int PHYSICALOFFSETY = 113; // Define DLL and prototype the Win32 API method [DllImport("gdi32")] public static extern int GetDeviceCaps(IntPtr hdc, int cap); // get the device context handle from the graphic object that is being printed // call GetDeviceCaps to return the offsets // release the handle to the device context int unprintableleft, unprintabletop; IntPtr hdc; hdc = e.Graphics.GetHdc(); unprintableleft = GetDeviceCaps(hdc,PHYSICALOFFSETX); unprintabletop = GetDeviceCaps(hdc,PHYSICALOFFSETY); e.Graphics.ReleaseHdc(hdc); MessageBox.Show("Unprintable: " + unprintableleft + " " + unprintabletop); Kyle
  • 0 Votes
    3 Posts
    0 Views
    K
    That was very helpful. Thank you. Kyle
  • Console app question

    question csharp visual-studio learning
    5
    0 Votes
    5 Posts
    0 Views
    V
    Run the program by pressing CTRL+F5. The command-line window will request you to press a key before terminating.:-O
  • Just wondering about the lag...

    csharp linux question
    3
    0 Votes
    3 Posts
    1 Views
    T
    Thanks matey, ngen ran without signing the exe. And now my app runs immediately. I think all this stuff should go into an FAQ somewhere. I wonder how many other people are puzzled by the same stuff. Thanks again, you're a great help Windows 98 (win-doze): a 32 bit Extension to a 16 bit Graphical Shell of an 8 bit Operating System originally coded for a 4 bit Processor by a 2 bit company that can't stand one bit of competition.
  • Directory.GetFiles()

    algorithms data-structures
    2
    0 Votes
    2 Posts
    0 Views
    P
    You can use the static method System.Array.Sort(). This method has overloads for sorting an array in place, for customizing the sort order (non-case sensitive, etc.), or for just sorting sections of an array. The sorting algorithm employed is QuickSort. -- Peter Stephens
  • Toolband with C#?

    csharp com question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • How to get windows directory?

    csharp c++ tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    J
    You need to use the StringBuilder class instead of string. StringBuilder strDir = new StringBuilder(20); GetWindowsDirectory(ref strDir, 20); James Sonork ID: 100.11138 - Hasaki "Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. :-D" - Michael P Butler Jan. 18, 2002
  • who can tell me what's wrong with the code

    csharp html com sysadmin help
    2
    0 Votes
    2 Posts
    0 Views
    J
    Are any exceptions being thrown? James Sonork ID: 100.11138 - Hasaki "Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. :-D" - Michael P Butler Jan. 18, 2002
  • Global instance

    csharp learning
    2
    0 Votes
    2 Posts
    1 Views
    J
    Can you describe what you mean by "globally available"? When you say that I'm thinking something to do with the GAC (Global Assembly Cache), but then you refer to an instance of a class. James Sonork ID: 100.11138 - Hasaki "Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. :-D" - Michael P Butler Jan. 18, 2002
  • handling WM_NOTIFY

    csharp question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied