Software Development Network Logo
  • Smart Devicet
  • Windows Vista
  • Visual Basic
  • SQL Server
  • Visual Studio
  • IE Development
  • Visual FoxPro
  • Windows Forms
  • Audio and Video
  • Visual C++
  • Microsoft ISV
  • .NET Development
  • SharePoint Products
  • Game Technologies
  • VS Team System

Software Development Network >> Visual C#

Visual C#

New Question

how to display the applications running on the system??
database DSN
& symbol not displaying on a label
Incorporate Java compiler in C#?
Converting
How to replace a line in a text file?
How to subscribe to event? ActiveX control in C#, client in C++!
file down loader heeeelllp!!!!!
Newbie: database to label or text
How to design these classes?

Top Answerers

Julianín
Tim Dallmann
Han Duong
Kea
DragonC#
gauls
SteveG_AU
Fusion54
CBuilder
JohnSLG
FAQ zu MS
Only Title

Answer Questions

  • BlitzTitan Best way to achieve this?

    I need to run a loop to check if a file exists then delete it. Once its deleted it can stop looking. However, at the time the loop starts it may not exist, but it will evntually be created. do { delete(); Console.WriteLine("Checking"); } while (check() == false); private static bool check() { if (File.Exists(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat")) return true; return false; } public static void delete() { if (File.Exists(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat")) { File.Delete(Environment.GetEnvironmentVariable("SystemRoot") + @"\myfile.dat"); Console.WriteLine("Deleted"); } } best practice would be to use a filesystemwatcher component (i' ...Show All

  • Shilov problem resizing images

    I found some code on the internet to resize an image, but when i want to resize an image to lets say 300*200 i get an image that is 266*200. I even tried 350*200 but still 266*200! This is the code: public void ResizeImage(int MaxWidth,int MaxHeight, string FileName, string NewFileName) { // load up the image, figure out a "best fit" resize, // and then save that new image Bitmap OriginalBmp = (System.Drawing.Bitmap)Image.FromFile(FileName).Clone(); Size ResizedDimensions = GetDimensions(MaxWidth, MaxHeight, ref OriginalBmp); Bitmap NewBmp = new Bitmap(OriginalBmp, ResizedDimensions); //Dit gebruiken als er geen gebruik gemaakt wordt van saveFileDialog //NewFileName = Fil ...Show All

  • ShrikantBijapurkar Get the computer Id

    I want to get computer id that always be uniqe even if windows of that computer have been changed. please tell me how and where I can find something like this. Code sample is helpfull too. where can i find my computer id which computer ID are you talking about The computer name if so, as stated earlier: Environment.MachineName; I have implemented the similar approach, which operates with hardware ids. It was constructing a string like "Processor1_ID=XXX,Processor2_ID=YYY,...,Primary_HD=ZZZ,...NIC1_MAC=...". Here is the painful experience: Desktops and servers are usually OK. Use combination of CPU ids and primary hard drive id. Laptop ...Show All

  • Ritesh305 How do you convert int[,] into object[,]?

    I've got 3 questions. Need help please, 1. I have a multidimension integer[5,3]  that needed to be converted into object[5,3]. Is there any best way of doing it 2. What is the best/common practice of searching a record (to see if it existed) a)  using executescalar() and what is the object that it returns b) any other suggestion 3. What is a safearray for Can anybody give me a simple example to demonstrate how to use safearray and its benefit Thanks in advance! no no no. Cast the thing. Thanks Matt, Is this what you meant   it doesnt work or there is a mistake in the following code int[,] sourceIntArray=new int[3,5]; ...Show All

  • invantix using an Observer Design Pattern with a reference property

    Hi, I was wondering if anyone who has used the Observer Design Pattern with a container of observers knows how to notify when there was a change to a Reference type Property's property. I have searched all over online, but all I can find is when the Property is of a Value Type. For example, check out my "TODO's" in the following code below: class Wheel {    private double _diameter;    private double _width;    public double Diameter    {      get { return _diameter; }      set      {        _diameter = value;               // TO DO: How do I say that ...Show All

  • catalinione quection about how to secure application

    First of all , Regards to all :) (If this post is unapropriate please delete it :( ) Well im trying to develop in C#.Net EE ... Im developing in C# like 5 days from now... And I can say that it is a interesting language. Now i have quections about some securitys and encryptions in C#.Net.. Well becouse it will be application with db auth. I wanna secure it as much as possible. The idea is next. I wanna create application only for friends. First I dont wanna that app got cracked. So i was thinking that application checks the processor PN on the app_load event. So it contacting db and searching if that PN exists.. if exists it allow him to enter the application otherwise it block the program. Allso i was thinked that it will be good to ...Show All

  • Erik Schröder input data to website

    Ok right now I have to configure routers manually by inserting the exact same data into a router's configuration panel (website on router) then swap out the configured router with one that needs the exact same setup and redo this process over and over. I would like to write an application that fills in all the needed boxes,selects values from drop down menu's and fills in any other information and presses the save & restart button for me is this possible I initially though about trying to find the file on the router that its writing to thinking making its one config file maybe if thats the case I could just write to the file but im not entirely sure. Good question. That is a bit more tricky and im n ...Show All

  • swathi_challa [var++] or [++var] for [for] loop

    I just recently noticed that for [for] loop in every single code I wrote and from code snippet in VC#, both use the same following code pattern (notice the increment pattern): for ( int i = 0; i < length; i++ ) { } AFAIK, the increment condition I should be the next value which is [i = i + 1]. And I think [i = i + 1] is better translated as [++i] rather than [i++], though both of them behave indifferently in the looping process. What do you think about this, guys its the same thing really, no difference just user perference i believe: i = i + 1 i++ ++i to me I believe is the same thing There's loads of games you can play with for(), especially since an expression can also be a statement ...Show All

  • hrd2hndl67 Difference between struct value or reference

    What is the difference between myStruct aStruct; and myStruct aStruct = new myStruct(); I would have thought that the latter was a reference type and if I put aStruct = bStruct; then aStruct would point to bStruct but in fact it just seems to copy the contents. Chardiot wrote: When you say "the latter creates two instances" are you saying myStruct aStruct = new myStruct(); creates two instances With Visual C# 2005, w hen I say "two instances" I mean a value is initialized twice (we're talking about value types, not reference types). The "myStruct aStruct" creates a local variable on the stack, implicitly initializing it. Value types init ...Show All

  • Hassan Ayoub Howto loop through attributes of an custom object for generating SqlParameters

    I have a Save-method in a class. This method gets an object of this class in from codebehind of my webpage, and i want to go through the attributes of the object to generate SqlParameters, and then put the SqlParameters inside an ArrayList and send to the Save-method in the DB-class. The code below works, but i want to do this without my method getParameterSet(Vare v) below the Save-method. I want to get parameter name, type and value from the objectattributes. //////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void Save( Vare v) { string sp = "" ; ArrayList sqlparam = new ArrayList (); ArrayList paramset = getParameterS ...Show All

  • swapna_n How to use the controls from another form in form I working in.

    I have problem, I was using the Visal Basic, and now have to migrate to the C#. Its not a problem. But in first steps with C# I have found a few diferences from VB. One I cant solve. For example in Form1 I have a TextBox1 and a Button1. I enter in TextBox1 "sviec", and click the Button1. Then opens the Form2 with Label1 on it and label says "sviec". In VB the Form2 code looks like this: Public Class Form2 Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load Me .Label1.Text = Form1.TextBox1.Text End Sub End Class So how I can translate this Me .Label1.Text = Form1.TextBox1.Text from VB to C# Thank You! ...Show All

  • MyoZaw list of classes

    a function, whose parameter is a ref to a collection of class I private void func(List<I> i){ i=new List<I>(); for(int n=0;n<MAXVALUE;++n){ for(int m=0;m<MAXVALUE;++m){ Dosomething(); } i[ n ] . value =5; // Error: can't modify the value of System.Collections.Generic.List<program.Form1.I>.this[int] because it is not a variable } The struct strure is folows public class I{ public int value; } Thanks for any helps I can't reproduce that, eg: class I { public int value; } class MyClass { public void func ( List < I > list ) { list[0].value = 5; } } Can y ...Show All

  • YRaj contents of release mode

    Hi My solution consists of three project that creats three dlls. first projects dll is used by 2nd project and 2nd projects dll is used by 3rd 1. do i required to release all these 3 dlls r only the 3rd 1. how i can release it regards Hi Thanks i tried with it but it didnt help. Application is running in debug mode on my machine but whaen i try with release mode or on another machine it dont work. regards Does the other machine have the .Net framework on it (And the correct version of it ) If not, then you have to arrange to install that also. You'll need to copy all three DLLs to the target PC. Keep them in the same folder as the .exe unless you need to share the DLLs wi ...Show All

  • arby99 Writing into the StandardInput Stream

    Writing a console app which spawns a process and redirect standad input via StartInfo object. That part works just fine. When I try to write into the Process.StandardInput, via the Write function, I can only write about 40K of bytes... (figured that out via debugging) but after that the Console app just sits there not doing anything/stuck/blocked/something... Does anyone have any clue to why I couldn't put more bytes into the input stream Thank you, Adi The streams must be read and written simultaneously. If you send 40K worth of data to the process then the process must read the data. At some point you will fill the internal buffer and deadlock on your next write. Until the process on the othe ...Show All

  • Dirk Reske Time Passed

    Is there any way to determine the amount of time that has passed from one specific point to another I.E. If the user logs in at 16:00 and logs out at 21:00 is there any way to tell that 5hours have passed Cheers Thomas That would be great but its .Net 2.0 and I have to use 1.1 :-( Thanks anyway Thomas can you show the code you are using The solution I provided earlier should do it for you if you copy it pretty much the same except replacing the variable names and form instances What if the endTime is not know. The user may stay logged in for 3hrs maybe 3.75hrs can it still be done Cheers Thomas I'm trying to pass startShift fro ...Show All

171819202122232425262728293031323334

©2008 Software Development Network

powered by phorum