-
- Console.ReadLine() not working
by Artichoker
- 5 Replies
- Last post
by Artichoker
- Hello. I am programming a simple text game on a console application. I have a method called "Input" that creates a prompt to enter your command, however the line of code
Code Snippet
string input = Console.ReadLine(); seems to get skipped so there is no time to enter a command, and it instead goes to the error checker, for which there is always an error. Can someone please t
-
- StackOverflowException
by Roberto Mason
- 2 Replies
- Last post
by Roberto Mason
- I'm fairly new to C#, and Visual Studio 2005. I'm developing a program for my school board, and was reviewing my code. In one of my class forms I was declaring two public strings. I was doing this in order to pass parameters from my parent form.
Since this is frowned upon, I decided to implement the get and set method. here is a snippet of my Code
namespace SummerSchool_005
{
pub
-
- over using Usings
by guyaton
- 2 Replies
- Last post
by Peter Ritchie
- I found some code that uses a lot of usings and I am fairly new to C# (most past dev has been in C/C++). I read on some forums that using statements essentially turn into this: // where foo inherits IDisposable interface foo bar = new foo(); try { [code snippet] } finally { [code snippet] foo.Dispose(); } I was curious about the speed/performance cost as well as good coding practices involving usi
-
- How easy is this in C#?
by Bwilhite
- 14 Replies
- Last post
by Bwilhite
- Sorry for the very general subject line. I've been working on a problem for some time right now that will have two separate applications passing information back and forth and preferably sharing objects. To date, I've been working on this problem using C++ and the WinAPI. However, the WinAPI and Visual Studio c++ 2005 don't really integrate very well. I've been taking a look at C# lately, and it
-
- Problem associating file extension with application
by t_ivanov
- 3 Replies
- Last post
by GunaChinna
- I am trying to associate a new extension with my application programatically writting in registry. I have done the necessary steps to create all subkeys in the HKEY_Classes_Root: HKEY_CLASSES_ROOT .myp (Default) = MyProgram.1 MyProgram.1 (Default) = MyProgram Application Shell (Default) = doit open command (Default) = C:\MyDir\MyProgram.exe "%1" DefaultIcon (Default) = C
-
- Reading a PC game memory results
by Beaulieu
- 4 Replies
- Last post
by Beaulieu
- Hi! Im trying to lear how to read memory from a PC game that is running on my PC. The game is Football and would like to find a way to save the results in a XML file.
Anybody know where i should start Or a good demo
thank you
-
- "[]" appear with column name when creating columns
by Computer Freek
- 2 Replies
- Last post
by Bora Inc
- when i am adding my database column name a "[]" appear at the beginning and ending of my column name is it common
Please reply me ASAP as i am on a project.
-
- "Couldn't acquire crypto service provider context" exception
by Aishwaria
- 1 Replies
- Last post
by Peter Ritchie
- Hi,
I am getting an error "Couldn't acquire crypto service provider context" while using RC4 in certain servers. Has anyone encountered this error.
-Aishwaria
-
- enforcing Decimal precision
by George F DArcy
- 7 Replies
- Last post
by George F DArcy
- Hi,
I was hoping someone could please shed some light on this for me
I am using a decimal property to store a currency amount. I want this decimal to have a precision of 2 decimal places. I've tried several ways, listed below, but I cannot get my decimal to return ".00" for whole numbers.
Things I've tried;
temp = decimal .Round(qty * price, 2, MidpointRound
-
- how to access next number in array
by x2012
- 3 Replies
- Last post
by the_grove_man
- Hi,
I'm very new to programming, so please bear with me. I need some help with arrays in C#.
How do I go about doing the following: I have an array with say 5 numbers in it and the program has to take every 2nd value and subtract it from the next number in the array. How would I go about doing this I know how I can get to every 2nd value in the array, but how do I perform a calculation
-
- Visual Studio 2005 TS crashes under Windows Vista Ultimate
by Michael Mortensen
- 14 Replies
- Last post
by JDavidW
- Dear sir or madam,
I am in urge of assistance regarding my VS2005 TS / VS2005 SP1 TS on Vista.
I started by sumiting my problem to MS Connect, but they totally ignored me, and that why I hope to get help here. For the original request, please visit this URL: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=243085
My problem is severe - if i open any file in
-
- Convert 1 byte to integer value
by Rex583305
- 4 Replies
- Last post
by Chunsheng Tang - MSFT
- I have a binary file, which stores each integer value in just 1 byte, is it possible to convert 1 byte directly into an integer value
I know, there is function like: BitConverter.ToInt16(buf, 0), but this function require the buf length is 2, if my buf length is 1, Can I convert it to integer values without converting the buf to length 2 buf
Thanks,
Rex
-
- Where are the messages going to?
by marffin
- 8 Replies
- Last post
by marffin
- hi everybody
I've already successfully implemented a globally low level keyboard and mouse hook and it seems that this is all .net managed code could provide in global hooking. But after I got the message by the hook, where is this keyboard or mouse message going to the parameters and structures of hook event don't contain that information. any idea
thanks in advance
-
- How to use string.replace to replace "\\" with "\" in a string?
by huabing78
- 11 Replies
- Last post
by Figo Fei - MSFT
- say, string = "abc//123"
I want to replace "//" with "/" so that it becomes "abc/123".
Thanks.
-
- Accessing my C# method from my form
by Leefri
- 4 Replies
- Last post
by friendlycoder
- Hi there
I have a add method in a class (call it TaskList) and I want to call it from my form class.
Within my form class:
Code Snippet
namespace TaskList
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//Create an instantiation of TaskList Class
TaskList myTaskList = new TaskList ();
}
-
- can any body help me in reversing strings
by adorer
- 14 Replies
- Last post
by James Curran
- this fuction help me to convert the arabic words to hexa .. and it doing the job 90% because it convert it in reverse
this means that the true hexa for example is (062F0645)
but the function returns it like this (0645062F)
and this makes each word come in reverse order
for example ...
I love you
becomes
uoy evol I
how can fix that
-
- "union" two types of variables using the same memory address.
by szsz
- 8 Replies
- Last post
by OmegaMan
- Hi I am using a one dimensional array with N 3 items and i need to return it in a three dimensional array. In other programing languages I have seen things called unions where two variables use the same address space for example an int[] and an int[,,] so my question : Can I (and if yes then how can I) declare a int[] and an int[,,] to use the same address space and work with it as an int[] but
-
- Loading object from dll and casting it to interface
by danni123
- 14 Replies
- Last post
by danni123
- Is it possible to load a class that implements specific known(to loader) Interface from dll and invoke methods that are implemented by this class simply by casting loaded object to this interface If I my dll is:
Code Snippet
interface IRef { int Doit(int n); } class Class1 : IRef { public int Doit(int n) { return n*2; } } And class that Loads it: Assembly a
-
- An unhandled exception of type 'System.DllNotFoundException' occurred
by vijayshankark
- 3 Replies
- Last post
by vijayshankark
- hi all
am using a library for image processing.
i have built a seperate application to compare images.
this application is working sucessfully and when i try to integrate this application with some other application then i am facing the error like this
An unhandled exception of type 'System.DllNotFoundException' occurred
Additional information: Unable to load DLL (VICTW32.DLL
-
- Testing input
by patio87
- 6 Replies
- Last post
by patio87
- How can I do a check to see if what is entered into a console.readline() is a word/letter, or a number
-
- A generic type conversion problem
by Ricky Wang
- 14 Replies
- Last post
by Ricky Wang
- With C#, is it possible to implement a generic type conversion function that contains two parameters, one is the value (object type) to be converted and the other is target type's identifier (a string) that the value is to be converted to.
For example, the function signature looks like
public static object GenericConverter(object value, string targetTypeName) {
// implemation
-
- gridvew play button...
by Danny Jr
- 0 Replies
- Last post
by Danny Jr
- Someone please look at www.syscpupower.com/rtone.aspx
You will see a gridview of my ringtone db, now what i am trying to get accomplished is when you click the windows flag logo you will get to play the song in whatever media player is your default player....
now i am guessing that i would use the RowCommand section of the properties, but i have no clue how. Does anyone have any Ideas...
-
- Compiling Native C & C++ code in VC#
by gowrishankar77
- 7 Replies
- Last post
by gowrishankar77
- Hello there!
I use Visual Studio 2005(the version that comes with VC#, VB and Tools for MS Office).
Can someone please give me a STEP-by-STEP instruction on how to compile C++ code in VC#
Kindly let me know.
thanks
gowri
-
- is it possible get something from previous page??
by JCJCJC
- 3 Replies
- Last post
by adorer
- I have a complex quesion about pass argument from page to another page
I've a webpage which is forum's list
when I run it on IE . which address is display like ¡ú ¡¾ http://localhost/news/news_c.aspx cid=26&FK=1 ¡¿
and now I have to write a page (use C#) for forum's content
I would like to catch "cid" from address of previous page
is it possible if yes. how can I do i
-
- Dialogs Cause Program to Freeze
by loffing.4
- 7 Replies
- Last post
by Figo Fei - MSFT
- I'm in the process of building a C# program. It uses a ColorDialog and a couple MessageBox.Show's. These dialogs have been working fine for a few days. Now however, whenever one of these dialogs should be displayed, the dialog never comes up and the program just freezes. This happens in both debugging and normal modes. I know this description is pretty general, but I was just wondering if anyone h