-
- How to Iterate through List or IList
by thukralz
- 14 Replies
- Last post
by James Curran
- i can add the values to the IList or List, if I need to get these values in the way they went it...Say I added 5 addresses to the list and I want them one by one...
I can use foreach and get all, but I need a way to only get one at a time or two at the max as I need to update some textboxes...
-
- array of structs in C#
by AmyChen
- 4 Replies
- Last post
by Matt
- Hi, I'm trying to output a list of artists from an array of structures as follows: struct artist { public string firstName, lastName public byte artist_ID, curator_ID public string Name()
{ return firstName + " " + lastName } ) And trying to output from array as follows: artist[] ArtistList = new artist[5] foreach (artist.Name() Name in ArtistList) { Console.WriteLine(Name) } Is the f
-
- Win32 API in C#
by Bilal Haidar - MVP
- 2 Replies
- Last post
by Bilal Haidar - MVP
- Dear all,
I would like to know if there is an event in Win32 API that I can handle in C# for double clicking a folder in the Windows Explorer and the expand event in the treeview
Thanks
-
- Application Configuration - Adding Sections
by koder monkey
- 3 Replies
- Last post
by Arnshea Clayton
- Hi People,
Does anyone know whether it is possible to add sections to the application/web configuration files when you add a custom assembly to a project automatically
I have written some assemblies and some of these assemblies have configuration information that is required.
It would be nice if this configuration (default) was added to the projects configuration file as soon
-
- DllImport
by Azurewrath
- 4 Replies
- Last post
by Azurewrath
- Hi,
What's the reason of encapsulating DllImport with [], like [DllImport("User32")]
Thanks,
aw
-
- Help Exporting functions from c++ to c# using Platform invoke and verifying signatures
by Kwacks
- 1 Replies
- Last post
by Mattias Sjogren
- I have 3 API¡¯s that I¡¯m exporting from a C++ library, MyTest.dll. These are the signatures of the functions and their corresponding C# signatures i created.
However I'm not getting the correct return types from the API's. Am I declaring the correct data types in C#. Can someone help me out with this, basically look at the umanaged declaration (which can't change) vs the managed function. Any
-
- If condition
by Azurewrath
- 14 Replies
- Last post
by CalvinR
- Hi,
In the book I am reading it shows examples like this:
if (!SourceFileExists()) return;
System.IO. File .Copy(txtSource.Text, txtDestination.text);
MessageBox .Show( "The file has been successfully copied." );
Isn't it better to write it like this:
if (SourceFileExists())
{
System.IO. File .Copy(txtSource.Text, txtDestination.text);
MessageBox .S
-
- how do we calculate exponentiation in c#
by rtaiss
- 1 Replies
- Last post
by Mark Dawson
- what s the equivalent of the vb.net ^ operator
Thank you
-
- Quick question on - Retreiving data from object's objects
by RRRouter
- 6 Replies
- Last post
by Martin Platt
- Is this the best way to retrieve data from object's objects Just asking so I know, since I think I'll be using this alot in the future. public class Compound {
Part partObj = new Part(); public Compound() { } public double Duration {
get { return partObj.duration; }
set { partObj.duration= value; } } } Does it look good
-
- Explicit primitive type conversion
by vikoe03
- 4 Replies
- Last post
by vikoe03
- Hi everyone,
I need some help and advise on the explicit type conversions in C#.
I have hit upon a problem when working with explicit typecasting. The following is the sample code that shows the issue:
float subsetsize = 0.7f;
int TotalSubjectsTested = 30;
// Explicit type casting
Console .WriteLine(( int )((( float )TotalSubjectsTested) * subsetsize));
// EX
-
- C# Conversion.
by Britto.S.V
- 4 Replies
- Last post
by OmegaMan
- Hi, What is the exact equivalent for "javax.imageio.stream.imageinputstream" .Kindly answer me please........... Regards..
-
- Compare two text contents in C#
by bacnt0508g
- 10 Replies
- Last post
by bacnt0508g
- I have a trouble !
I have a two string, something like this:
string requestOne = "Hello, I'm from Canada and pleased to see you";
string requestTwo = "Hello, I'm from Viet Nam and my name is Bac";
and now I want to compare two strings and value returned is a percent of the same !
string requestOne = " Hello, I'm from Canada and pleased to see yo
-
- Difference between Internal and Protected Internal
by gomaz
- 9 Replies
- Last post
by Ye Yan
- Hi All, What is the Difference between Internal and Protected Internal I need some real time example. Regards Gomaz
-
- What is Parsing error(CS8025)?
by flamethrower5120
- 3 Replies
- Last post
by Chuck the Code Monkey
- What is Parsing error(CS8025) What is the usual cause of it Flamethrower 5120
-
- could not find file--dll
by venp
- 3 Replies
- Last post
by Mark Dawson
- Hi ,
i created a dll and i'm able to add the dll thru add reference.
then i created a new instance like the below
dllapplication.dllprogram d = new dllapplication.dllprogram();
private void print()
{
d.display(); ---i'm able to select the method of the new instance.
}
then i build it got succeeded. but while executing i get error like , could not find file.
pleae he
-
- Converting UTC to local time
by WRBehning
- 14 Replies
- Last post
by JoseBonifacio
- I have an application that is designed to schedule certain activities to run at certain times on various servers located around the country. Actually, the app is similar in functinality to Windows Scheduld Tasks. Anyway, one requirement is for the app to be able to recognize and convert datetimes to the local server's timezone.
I am storing the data in a SQL server table. 
-
- Interfaces
by lawwz
- 13 Replies
- Last post
by OmegaMan
- Sometimes it seems, that you use an interface like this
public class myclass : InterfaceName
{
}
Meaning the class will inherit from that interface
Then you use it like
public static InterfaceName functionName()
{
}
which it returns a reference to an interface which is like saying its now a type.....
-
- How to convert from string to object of any type
by SaloS
- 7 Replies
- Last post
by SaloS
- I need to convert from string that contains data to object of some type that is passed. I write some kind of serializer of object to/from collection of strings. Does someone know class that can get string and destination type and return object of specified type as a result. I think this functionality must exists but I do not know where because this kind of functionality should be used in XmlSerial
-
- Call forwading using TAPI
by Jehan Badshah
- 2 Replies
- Last post
by TilakGopi
- I used TAPI for an IVR system, I want to forward a call to a telephone number, how to achieve this functionality.
Thanks
-
- Audio Converter code
by Landon Parks
- 1 Replies
- Last post
by ahmedilyas
- Does anyone know the code for an Audio file converter
I'm looking for a code that will convert several well known audio file types to either .mp3 or .mp4 files.
Thanks!
-
- New Process and environment variables.
by Andrei Ivanov
- 8 Replies
- Last post
by Andrei Ivanov
- Hello all.
I would like to implement a little function that does the following:
Function is passed a URL in a string. Upon execution, it needs to open a new browser window and display that URL. The site at the URL is a JAVA applet.
I've tried the following:
Code Snippet
public void Start(string address)
{
Process.Start(address);
}
Now, while this works
-
- All purpose Internet Connection Status Monitor
by Xancholy
- 1 Replies
- Last post
by Figo Fei - MSFT
- I've looked at so many code samples to simply check internet connection status before navigating a webbrowser to an url.
Please can someone point me to the best bar none code for all scenarios (dial up, non-IE clients, firewalled, etc) that you're currently using.
Thanks
-
- using or operator with strings and ints
by new to sql server
- 6 Replies
- Last post
by Kent Boogaart
- I have written the following nested if to prevent someone from entering a value that won't work. I am trying to get the user to enter a value between 1 & 13. When I run this I get the following errors for both of the "if"s that use the comparison operators.
This is the error that VS 2005 express gave me. "Operator '<=' cannot be applied to types of string and int."
-
- Code generation for property 'cursor' failed error in VS?
by huysmans
- 12 Replies
- Last post
by Schacki
- Hi, I'm getting the following error in VS2005 pro on xp sp2; 'Code generation for property 'Cursor' failed. Error was 'CursorConverter' is unable to convert 'System.Windows.Forms.Cursor' to 'System.ComponentModel.Design.Serialization.InstanceDescriptor'.' Anyone know what this is about
-
- Method help
by singerpop
- 1 Replies
- Last post
by H. Tony Wang
- There are tow threads.One writes datas into a buffer which size is finited continuously and another reads parts of these datas sometimes.How to setup this buffer and solve the threads conflict in C#