|
|
Watt?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
I'm not going to give you the code - but I will give you some hints. How often do you think your timer will update (take a look at this[^] article before you commit yourself)? How do you think you need to divide the values up (think about dividing by 60 - and multiples thereof)? You are going to need a formatter.
Alternatively, you could use a trick and get the difference between the time your application starts counting and the current time using the DateTime classes. Again you will need a timer.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: I'm not going to give you the code
right. give him the force.
nice reference BTW.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
HI,
i Like to know if there is away to create a treeview
that consists of (buttons,other possible control)
does VS .NET 2005 have a ToolBox Contol?
iCould'nt find it
if it does not appear can i create one and how?
THNKS
kobkob
|
|
|
|
|
kobibi wrote: i Like to know if there is away to create a treeview
that consists of (buttons,other possible control)
you can customize the contol's fuctionality and outlook. I havent done this kind of customization myself but here's a sample article for u to get started.
Control Customization[^]
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Hi,
Wanna to write Socket programe which should have Client and Sever, Nead to open only one socket between Server and Cleint by using the same Socket i want to do Send and Receive as many times i want insted of closing and open for every trasnfer.
- Thanks
|
|
|
|
|
Good luck in your endevour. However, I assume you actually wanted to ask a question rather than tell us all what your plans are.
|
|
|
|
|
Colin Angus Mackay wrote: Good luck in your endevour. However, I assume you actually wanted to ask a question rather than tell us all what your plans are.
I wanna get a cup of coffee. Wish me luck.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: I wanna get a cup of coffee
Good luck with the coffee. Remember, be careful of the hot water... It can burn you if you are not careful.
|
|
|
|
|
Colin Angus Mackay wrote: Good luck with the coffee. Remember, be careful of the hot water... It can burn you if you are not careful.
You see, that's the type of advanced stuff that only comes about through knowing how to do things like TDD and refactoring.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
If you are asking how to begin what you want to do, have a look at the System.Net.Sockets.Socket class, and try searching Codeproject site for articles. You'll find everything there.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
hi all
i have a txt file a.txt inside the folder D:\myolder\urfolder\folder\a.txt
is ther any option to read the name of urfolder.i know only the name of the txt file. want to find the folder name. i know we can find the path by string path = Path.GetFullPath("a.txt"); but i want only the middle folder.
plz help me
plz....
i tried using substring, but the folder name length differs....
so that is also not possible
plz do help me
|
|
|
|
|
use the following code...
System.IO.DirectoryInfo di=System.IO.Directory.GetParent(@"D:\myolder\urfolder\folder\a.txt");
string middledirectory=di.parent.Name;
Koushik
|
|
|
|
|
Hi.
I have a C# app that I wrote in Visual Studio, in Windows. There are a few libraries that my code needs to use, and they were written in C, in Linux. I am totally new to this. Is there an easy way to either convert the C code to C#, or to allow my C# app to access the C code? I tried compiling the C code in visual studio, but some of the libraries included are *nix based/specific, and I don't know their counterparts in Visual Studio under Windows.
|
|
|
|
|
Hi I am preparing for interview for Motorola on C#, Please suggest me for some sites or forums where I can get interview questions and answers.
Actually I searched in google, but couldn't get clear cut answer.
I have few questions
Difference between Debug and Release?
What is Doc Switch?
Can you brief me about Generics and Partial Classes.
What are static classes?
what are indexers in C#?
What does immutable mean?explain?
how to create a singleton class(A class to which only one instance can be created throughout the application)
And finally Please tell me what is Type Safety (in C#)
Thanks,
Prashanth
|
|
|
|
|
Have you considered learning the answers to these questions yourself?
I think it's a bit cheeky to ask people on this forum for the answers to interview questions to help you get a job. Especially when the questions are fairly basic and a quick search on MSDN would have yielded the results.
Paul Marfleet
|
|
|
|
|
Hi Prashanth.
Please take a look at these answers:
1. Debug build contain debug symbols and can be debugged while Release build doesn’t contain
debug symbols and hence cannot be debugged.
When an application is built using Debug build, a .pdb file is generated in the bin folder
while this does not happen in Release build.
There will be a speed difference, because of disabling debug methods.
2. Instance methods are associated with an object and use the instance variables of that
object. This is the default.
Static methods use no instance variables of any object of the class they are defined in. If
you define a method to be static, you will be given a rude message by the compiler if you try
to access any instance variables. You can access static variables, but except for constants,
this is unusual. Static methods typically take all they data from parameters and compute
something from those parameters, with no reference to variables. This is typical of methods
which do some kind of generic calculation. A good example of this are the many utility methods
in the predefined Math class.
Ramorua
|
|
|
|
|
pashitech wrote: What is Doc Switch?
He's the replacement for General Access Violation. As you know, .NET runs in a managed environment so it protects you from accessing memory area that you shouldn't using a process called Memory Switching. The nickname for the feature that does this is called Doc Switch (the Doc being short for Doctor).
pashitech wrote: what is Type Safety
It's the set of tests (a bit like Euro NCAP) that saves your application if it crashes.
pashitech wrote: Difference between Debug and Release?
Debug is the process of getting software into the beta phase. Once it's ready to roll, you move it to the Release phase.
If you liked these answers, the please let me know so that I can give you other wrong answers to more stupid questions. Alternatively, why the hell don't you actually get off your a*se and do some research yourself. There's this wonderful tool - called Google - that would answer these questions and more. More importantly, it would give you a valuable life skill - the ability to actually look something up for yourself instead of wanting others to do your thinking for you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
pashitech wrote: Difference between Debug and Release?
The biggest difference between these is that:
In a debug build the complete symbolic debug information is emitted to help while debugging applications and also the code optimization is not taken into account.
While in release build the symbolic debug info is not emitted and the code execution is optimized.
Also, because the symbolic info is not emitted in a release build, the size of the final executable is lesser than a debug executable.
One can expect to see funny errors in release builds due to compiler optimizations or differences in memory layout or initialization. These are ususally referred to as Release - Only bugs
In terms of execution speed, a release executable will execute faster for sure, but not always will this different be significant.
pashitech wrote: What is Doc Switch?
that gathers all such documentation lines and generates HTML reference pages."
According to 'csc -?' the '/doc:<file>' switch is for "XML Documentation file to generate", not HTML. (I could find no reference to HTML under csc -?) Also, the only Output option in VS Express (Project -> MyPhotos Properties ... -> Build tab -> Output) was for "XML documentation file:" After rebuilding the project I inspected the directory structure and found a XML file; there was no HTML file(s).
pashitech wrote: Can you brief me about Generics and Partial Classes.
Generics and Partial classes
pashitech wrote: What are static classes?
A class can be declared static, indicating that it contains only static members. It is not possible to create instances of a static class using the new keyword. Static classes are loaded automatically by the .NET Framework common language runtime (CLR) when the program or namespace containing the class is loaded.
Use a static class to contain methods that are not associated with a particular object. For example, it is a common requirement to create a set of methods that do not act on instance data and are not associated to a specific object in your code. You could use a static class to hold those methods.
pashitech wrote: what are indexers in C#?
C# introduces a new concept known as Indexers which are used for treating an object as an array. The indexers are usually known as smart arrays in C# community. Defining a C# indexer is much like defining properties. We can say that an indexer is a member that enables an object to be indexed in the same way as an array.
<modifier> <return type=""> this [argument list]
{
get
{
// Get codes goes here
}
set
{
// Set codes goes here
}
}
pashitech wrote: What does immutable mean?explain?
An object qualifies as being called immutable if its value cannot be modified once it has been created. For example, methods that appear to modify a String actually return a new String containing the modification. Developers are modifying strings all the time in their code. This may appear to the developer as mutable - but it is not. What actually happens is your string variable/object has been changed to reference a new string value containing the results of your new string value. For this very reason .NET has the System.Text.StringBuilder class. If you find it necessary to modify the actual contents of a string-like object heavily, such as in a for or foreach loop, use the System.Text.StringBuilder class.
pashitech wrote: how to create a singleton class
http://dotnetslackers.com/community/blogs/simoneb/archive/2007/04/17/ASP.NET-Singleton_2D00_per_2D00_Page-pattern.aspx[^]
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
pashitech wrote: Please suggest me for some sites or forums where I can get interview questions and answers.
There are hundreds of them containing millions of questions. If you can memorise all of these then I would recommend that you actually learn your subject area instead as it would be much more beneficial to you than learning to parrot an answer.
pashitech wrote: Actually I searched in google, but couldn't get clear cut answer.
There is no clear cut answer. Every interview is different and depends on what the company is looking for.
pashitech wrote: I have few questions
Difference between Debug and Release?
What is Doc Switch?
Can you brief me about Generics and Partial Classes.
What are static classes?
what are indexers in C#?
What does immutable mean?explain?
how to create a singleton class(A class to which only one instance can be created throughout the application)
And finally Please tell me what is Type Safety (in C#)
You should know most of these already if you are going for a job as a software developer. If you come to us and pull the wool over our eyes in the interview and we hire you, you'll be booted out the door quick enough when we realise you were faking it.
Do NOT try and hoodwink the interviewer. You will end up with a poor reputation.
|
|
|
|
|
Colin Angus Mackay wrote: Do NOT try and hoodwink the interviewer
Just kicked somebody out of an interview because they tried to bull me. Asked a simple question about interface inheritance and they went off onto a long waffling answer to try and hide the fact that they didn't know. I'd have been more impressed if they actually came out and said they didn't know.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You should come down to DDD6[^] in November - I'm doing a session on recruitment (assuming it gets voted in)
|
|
|
|
|
If I can make some time in the schedule, I'll try to get down.
Deja View - the feeling that you've seen this post before.
|
|
|
|