-
- How to distinghuis between development and deployment?
by mshvw
- 3 Replies
- Last post
by ctusch
- Hi, During development I need to read file A and converted it to another file B then using this file B. During deployment (users running my application) only file B must be supplied. How can I make my application execute a function that searches and reads file A but only does this during development In C++ there were these '#' conditional compile options. Is there some equivalint in C# H.
-
- Basic equation
by boomoto
- 2 Replies
- Last post
by boomoto
- Ok i'm still learning c# i'm doing a project for school and i'm tryign to create a basic program where it calculates the shippign cost based on weight, The problem i'm having is i can;t mutiply my final answer by 0.12 it gives me
Error 1 Operator '*' cannot be applied to operands of type 'decimal' and 'double'
now my code is this
private void Btn_Calculate_Click( object s
-
- Best way to update a class when modifying a member
by csaavedra
- 4 Replies
- Last post
by frederikm
- Hi, I have a UserControl derived class containing a Label, which I would like to be updated every time a public string on the class is modified. For this, I created accessors for the public string, in this way: public class MyControl : UserControl { private Label _label; private string _string; public string MyString { get {return _string; } set {_string = value; _label.Text
-
- Completely Invisible/Hidden Application
by aler2u
- 10 Replies
- Last post
by aler2u
- I wanna create such an small application/exe which will be completely hidden/invisible to the user when it is run. Even it will not be displayed in the taskbar, system tray, task manager(application tab). I've no problem if it is: a) a console application or any other types of application (but i don't wanna see the splash screen of MS-DOS screen when I'll click on my .exe file) b) only showed
-
- System.Char[] question
by AlexBB
- 10 Replies
- Last post
by AlexBB
- I am running a continuous download of records from a server. To monitor the progress I use a progress bar and at the same time I send symbols to a RichTextBox via an invoker. The symbols are just added to the previous content with a single space separating them. It is a continuous line for symbols but they are wrapped around in a small window thus I see about 6 symbols per line.
At certain time
-
- Order of properties, methods
by Azurewrath
- 9 Replies
- Last post
by Azurewrath
- Hi,
Is it better to write properties before methods in an interface Is there a optimal or preferred order for this and classes Like:
class def
{
properties
constructors
public property methods
methods
etc
}
Thanks,
aw
-
- '/target:module' compiler option
by FelipeAngriman-MSP
- 3 Replies
- Last post
by FelipeAngriman-MSP
- Hi, i been googling around for a while and i can't find good info about '/target:module' csc option. what about if any of you C# MASTERS points me into the right direction. I mean C# doesn't let you create modules as VB.NET. so..... whats the compiler option for or what the use of the 'module' global-attribute-target anyway
I'm new in this things of posting stuff son i apologize if this top
-
- Object lifetime - finalization, disposition
by ebence
- 2 Replies
- Last post
by timvw
- Hello,
I am not quite sure if a used object should be explicitly killed. Should I use the Finalize() method, or set myObj=null
For example I want to show a modal form to the user. So I place the following code into a button's click event handler:
Code Snippet
Form2 myForm=new Form2();
myForm.ShowDialog();
//Do I need the following line
myForm=null;
-
- differecse between AppendText and Text+=
by bola shokry
- 5 Replies
- Last post
by Peter Ritchie
- What is the difference between:
1) rishTextBox.AppendText("any text");
2) rishTextBox.Text+="any text";
the second arise a problem but the first dont make the problem.
-
- how to open .csproj in xml file through C# code and add a file as a link????
by Situ
- 2 Replies
- Last post
by timvw
- Hello
how to open .csproj in xml file through C# code and add a file as a link
I want to add CommonFileInfo.cs in more than one project for this i want to add "CommonFileInfo.cs" file as a link in project.
So I want to open every .csproj in xml file and add this code.
<Compile Include="..\Projects\CommonFileInfo.cs"> <Link>CommonFileInfo.cs</
-
- What did you do when have to fix a code with 8.000 lines?
by Edwin Santos
- 6 Replies
- Last post
by Edwin Santos
- How do you organize yourselves to begin to fix a code with 8.000 in a sigle method
I know tha's crazy, that's wrong but if you have to..
Do you create diagrams to draw do code, descritions, what
Ed
-
- Multi Interface inheritance
by bpeikes
- 14 Replies
- Last post
by bpeikes
- Lets say you have two interfaces: interface IA: IComparable { int A {get; set;} } interface IB: IComparable { int B {get; set;} } and a class which implements both IA and IB class C: IA, IB { } class C now has to implement CompareTo, but the problem is that CompareTo should do different things if being used to compare this object to another IA, IB or classC. How do you implement the CompareTo
-
- I want refer the assembly dynamically
by vijil
- 6 Replies
- Last post
by vijil
- Dear all,
In our project we need to refer the assembly dynamically without the help of webconfig file.
Here I am explaining briefly
<assemblies> <add assembly="office, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/> <add assembly="Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/
-
- random number problem
by walking fish
- 14 Replies
- Last post
by Ernst Kuschke
- 1:892 2:951 3:363 4:418 5:301 6:208 7:400 8:522 9:321 10:293 11:212 12:712 13:195 14:570 15:485 16:409 17:414 18:928
19:
================================================================
here are 18 groups of data ,and they are selected at random from 000 to 999
based on these numbers ,can you figure out the inner relationship among these datas,and try to predict the 19th group of data
-
- Get current user's GUID
by Muzzzy
- 7 Replies
- Last post
by DaWolf
- Hi, I'm going to integrate my application with Active Directory, so that if i add a Windows user to the app, he/she will not need to login with the app's credentials, pretty much like you have SQL server in mixed mode - you can use SQL login, or you can use windows authentication. So i figured out that for Windows users i shouldn't store the username but rather the objectGUID of that user, because
-
- Input Formula from a TextBox
by sizhen
- 1 Replies
- Last post
by Martin Platt
- Dear Sir,
I need to input a formula from a TextBox at runtime. But the input data is taken as a string. How I convert this string so that it can work as a formula and get the result to assign to a float (or double) varible In C#, is there some class providing this kind of function Thanks a lot!
sizhen
-
- How to change dynamically a method's behaviour
by duanerb
- 7 Replies
- Last post
by CalvinR
- Hi, I would like to change, durring runtime, the way a method behaves. I don't now all the way the method will behaev since it's a user that will define during runtime the new method body and decide to switch to it. An exemple : public class test { private string _s; public void testFunction() { Console.WriteLine(_s); } } 1-This class is loaded in memory and some insta
-
- How might I re-write this code?
by NytewolfAU2k7
- 4 Replies
- Last post
by Jason D_dot_NET
- Hello, I was just wondering how I might re-write this piece of code to avoid CS1612
private void btnLog_Click( object sender, EventArgs e)
{
if ( this .Size.Height == 237 && this .Size.Width == 243 )
{ cursize = "large" ; }
else { cursize = "mini" ; }
if (cursize == "mini" )
{
btnLog.Text = "Show Log
-
- C#: Instance indexer
by recherche
- 4 Replies
- Last post
by eradicator
- Hi!
How to call base class instance indexer using 'base' in a derived class instance method as in the following code snippet:
using System;
class MyClass { int[] array; public int l;
public bool error; public MyClass() {
}
public MyClass(int size) { array = new int[size]; l = size; }
public int this[int index] { get { if(o
-
- How to make a program unstoppable
by andriscs
- 14 Replies
- Last post
by andriscs
- Hi, I have a program that has two goals: start with Windows (XP) and always keep running until Windows shutdown. The user is a limited user of Windows XP. How can I start the program that the user won't be able to terminate it with task manager or taskkill I thought about starting my program as a Windows service (I am not aware of what can be started as a Windows service - is it possible to start
-
- Problem: The breakpoint will not currently be hit. No symbols have been loaded for this document
by TomL23560
- 14 Replies
- Last post
by crgsmrt
- Hi,
I've run into a problem that seems to defy a solution. Bottom line: When I'm attempting to debug with VS 2005, I cannot set an effective breakpoint in one of the source files. The breakpoint is the hollowed-out reddish/yellow circle, and VS says that the breakpoint won't work because the symbols are not loaded. I've found several discussions in this forum about this type of problem, but the
-
- How to assign an explanation to a function in c#
by Kursat Konak
- 3 Replies
- Last post
by Kursat Konak
- Hello,
I have functions in my library, but their explanation isn't enough to understand by only looking at their signatures. Meaning
Like whenever you go over a DataAdapter.Fill() Method with your mouse, it will explain to you what that function does in 2-3 lines. But when you go over my function with your mouse it only tells you the signature. I want to learn how to add information for my
-
- Strings with PInvoke
by likestoski
- 5 Replies
- Last post
by Anonymous280z
- I am receiving a 'Attempted to read or write protected memory. This is often an indication that other memory is corrupted.' error when using a PInvoke call. Below is the Visual C++ and C# code. I have tried using StringBuilder and String return types as well as passing a StringBuilder to the C++ but cannot get this to work correctly. This is an urgent matter so any help will be greatly appreciated
-
- retrieve integer values from console
by Kaushalkumarrai
- 3 Replies
- Last post
by Martin Xie - MSFT
- Hi, I am new to C#, infact new to this whole world of programming. I want to know, how to retrieve integer values from console.
-
- Cast to instance of type
by dob_xml
- 3 Replies
- Last post
by Peter Ritchie
- Is it possible to do the following
private static void Main(object toCast)
{
Type toCastTo = GetCustomType();
//now I would like to be able to cast the object toCast to be an instance of MyCustomClass
//assume MyCustomClass could be any class and the only way this function knows about it is
//via GetCustomType()
}
private Type GetCustomType()
{
r