microsoft.public.dotnet.languages.csharp Archive - May 2002
Post a message to this list
Messages
Page: 1234567891011121314151617181920
212223242526
Delay executing C# programs (2 replies)
microsoft.public.dotnet.languages.csharp
Has anyone experienced the problem of a short delay executing a program written in C#? I have a simple "Hello, World" program that will take generally around 15 20secs in starting up (in either debug or release). My machine is suffiecient enough to handle all of the requirements for Visual Studio .Net. I have tried re installing the .Net framework, and I even formated my machine and loaded everyth...
How to use atoi in C# (3 replies)
microsoft.public.dotnet.languages.csharp
i want to swap a string to int .using C# C : char[10] ch {"1234"}; int i; i atoi(ch);
arrays in c# (2 replies)
microsoft.public.dotnet.languages.csharp
Hello, Absolute newbie in c# here... Anyway, i'm trying to come to terms with ArrayList and think there is something fundamental I am missing. Basically I have my own class, of which I would like to have a dynamically resizable array of objects of this class. I want to be able to access these objects to get or set their properties and also to call their methods. I have the array list going fine an...
Searching an entire hard drive for a file (4 replies)
microsoft.public.dotnet.languages.csharp
Anyone have the code worked out to scan every file in every directory on a hard drive to locate a single file possibly using DirectoryInfo and FileInfo? Kyle *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
FileInfo Class - Holding onto Resources - File in Use - Garbage Disposal (2 replies)
microsoft.public.dotnet.languages.csharp
The Problem: When using an instance of the FileInfo class (C# & .NET): I get the following error message: System.IO.IOException: The process cannot access the file... I have enclosed an attachment of the error message, a .jpg file. The Code: // Notice that the following files have the same name, in different directories. FileInfo fiSource new FileInfo(@"c:\LasVegas.jpg"); FileInfo fiTarget new Fil...
Call Stack (2 replies)
microsoft.public.dotnet.languages.csharp
Hi guys Is there any way to access the call stack information inside a C# app? Initially I want to call a method on a custom trace object which records that the method has been called, and when the method has completed. I don't want to have to do something like public void ProcessData() { myCustomTrace.Log("ProcessData() called..."); ... myCustomTrace.Log("ProcessData() completed"); } I would rath...
Constant Arrays (6 replies)
microsoft.public.dotnet.languages.csharp
Hi, I have a load of constant mapping data that all has the same structure, and I want to hold it in a constant array of structures. struct DBMap { public string fldname; public int fldsize; etc } class MapStructApp { DBMap[] ActivityMap {"activity id", 10, "Activity Id", false, 64, 99.... My question is what is the syntax to declare the next element in the array??? Real simple stuff I know but......
how to debug remote object hosted on IIS? (2 replies)
microsoft.public.dotnet.languages.csharp
the component works well locally but after i host it on IIS,i just return false to me,and i cannot trace into the code. the config files are well set,and the client did create object on server. i just want to trace into the code. also,my component is a ServicedComponent,which makes a little complex. once i can trace into code,every thing will be easier. thanks.
Shutdown Computer (3 replies)
microsoft.public.dotnet.languages.csharp
Anyone can send me a code example to shutdown a computer. Maybe i can reuse this code for reboot sending another parameters to the InvokeMethod? SelectQuery query new SelectQuery("select name from Win32 OperatingSystem where primary true"); ManagementObjectSearcher searcher new ManagementObjectSearcher(query); foreach(ManagementObject os in searcher.Get()) { os.Scope.Options.EnablePrivileges true;...
How to "convert" a double value to an array of byte values? (5 replies)
microsoft.public.dotnet.languages.csharp
Hello, I try to port some older pascal (later delphi) code to c#. I would like to store a double value in an array of bytes. The old design uses "move" for simply moving the memory from the double value to the byte array. I suppose this is not possible in c# any more. But perhaps there is another way? Btw. I could also use an array of ints, the last solution would be an array of doubles, where I c...
what is the c union keyword in c#? (4 replies)
microsoft.public.dotnet.languages.csharp
We have a complex struct in c that we would like to convert in c#, however, it uses the union keyword. What is the equivalent in c#???? following, c source code struct mxArray tag { char name[mxMAXNAM]; int reserved1[2]; void *reserved2; int number of dims; int reserved3[4]; union { struct { void *pdata; void *pimag data; void *reserved4; int reserved5[3]; } number array; } data; };
dllimport SHFIleOperation struct NullReferenceException (2 replies)
microsoft.public.dotnet.languages.csharp
I am getting NullReferenceException when calling the SHFileOperation passing the struct by ref. Any idea what I am missing? I have tried specifying [MarshalAs(UnmanagedType.LPStr)] for each of the string inside the struct. Any help would be appreciated. I am trying to use SHFileOperation for file system management since the System.IO.File and System.IO.Directory are not meeting our needs. Thanks M...
Find User Context of an existing process (3 replies)
microsoft.public.dotnet.languages.csharp
I want to find the user context of an existing process. Basically I want to find out who the interactive user is from a service. I've can get a reference to the "explorer" process, does it run under the context of the current interactive user?
How to start a program from a C# application. (4 replies)
microsoft.public.dotnet.languages.csharp
Hi Everybody. I want to start a program for example NotePad.exe from a C# application. I tried with this statement Tools.Shell """C:\WINNT\System32\Notepad.exe"""; but the compiler doesn't acceppt it. Tools.Shell is what I can find i C# MSDN. Please tell me what to do. Thanks Trung
restart server? (3 replies)
microsoft.public.dotnet.languages.csharp
I am writing a C# windows service, and one of its fucntions (hopefully) will be to restart the server it is running on a a stpecified time. My question is, is there a built in class to handle this (the restart of the server) or do I have to use an API. And if if I have to use and API, exactly which one and what are the decalrations. Any help would be greatly aprreciated. TIA Paul Easter
OpenFileDialog problems (2 replies)
microsoft.public.dotnet.languages.csharp
I have a problem with the OpenFileDialog object. I have multiple file type, and, when I change my file type (in the combo box file type) all file disappear, even if I come back to all files. I have to change directory for the directory listing to be refreshed. any idea ? OpenFileDialog ofd new OpenFileDialog(); ofd.Filter "All files (*.*)|*.*|MyFormat|*.my"; ofd.DereferenceLinks true; ofd.CheckFil...
Hello World Web service (2 replies)
microsoft.public.dotnet.languages.csharp
Hi, I am sure there is something easy that I am missing but I am implementing the Hello World web service and I see the web page fine but when I click invoke I get a page cannot be displayed error. Any Suggestions? Thanks in advance.
Unicode int to char casting (2 replies)
microsoft.public.dotnet.languages.csharp
Hi all, I recently created an function for my application that converts HTML Character Codes (ISO8859 1) into their actual values. (ie. © ) (copyright symbol) Here is the function: public string ConvertNumericCharCodes(Match m) { // Finds the numeric character code int intCode Int32.Parse(Regex.Replace(m.ToString(), @"(&#)(\d )(;)", "$2")); // Returns the character represented by the code ret...
send out email from Windows Service application (5 replies)
microsoft.public.dotnet.languages.csharp
Hi, I am building a Windows service app that need to send out emails. Any one know which .NET class should I use? I am using System.Web.Mail.SmtpMail class, it does not work. Thank you. Mike
I need to get a datagrid to work (2 replies)
microsoft.public.dotnet.languages.csharp
I have an array of structures. I'm wanting to show this in a datagrid. How can I do this?
System.Web.Mail (3 replies)
microsoft.public.dotnet.languages.csharp
Im haveing trouble using the System.Web.Mail.SmtpMail object. This object has a property named SmtpServer that handles a string for the name of the SmtpServer that you want to send mail through I have tried all methods I can think of to set this Property but to no end I always get an error of some sort or the other. If any one has some information about this please let me know.
Find XML value from C# (2 replies)
microsoft.public.dotnet.languages.csharp
I'm just experimenting with C# and its intergration of XML. How easy has Microsoft made it for us to "parse" the XML file to retrieve the data within a given tag? Would anyone be kind enough to demonstrate? Thanks.
ArrayList and structs (2 replies)
microsoft.public.dotnet.languages.csharp
If you add a struct to an ArrayList how to you get a reference to the struct back from the ArrayList. See code. Thanks Ken struct myStruct { String str; } myStruct myStruct; myStruct new myStruct; myStruct.str "Hello"; ArrayList aList; aList.Add(myStruct); //How do you do this????????????????????????????????? myStruct aList[0];
how to add multicast delegate ? (3 replies)
microsoft.public.dotnet.languages.csharp
Hi I have created the following class. Basicaly it is wrapped around a timer and is a singleton. What I want to do 1) Allow couple of other objects to subscribe to this class Event. So when the timer elaps, all my objects will get an event thrown to them. how can I use multicast delegates in this class? 2) When one of my objects does not want to get notified any more for timer events, how can I un...
Second highest value from array (3 replies)
microsoft.public.dotnet.languages.csharp
Hi Sorry to be asking yet another question, but I am trying to figure out a way to get the two highest values out of any array. I am able to get the max value using the for loop below, that is pretty easy. I have no idea how to go about getting the second highest value however. If anyone could offer some help, that would be great. for (int i 1; i totalArray.Length; i ) { if (totalArray[i] maxVal) ...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com