|
Empty is normally a static readonly field such as...
public struct YourStruct
{
public static readonly YourStruct Empty = new YourStruct();
}
|
|
|
|
|
However, can a struct really be empty? it has a fixed size after all, unlike a string or a list.
OTOH, .NET does offer a Size.Empty and a Point.Empty; if I had a say, I'd call it Zero, not Empty.
|
|
|
|
|
Luc Pattyn wrote: can a struct really be empty? it has a fixed size after all
Very true.
Luc Pattyn wrote: I'd call it Zero
I think MS reserve that for single value structs such as IntPtr which uses Zero .
|
|
|
|
|
I'm trying to learn c# from knowing a much more idiot proof programming language (autoit) and I'm completely lost. I thought I'd start out with a simple windows form project of a ping utility that someone else had written and then modify it from there and be able to learn where I have a working example and can alter the code in different places and visually see what changes.
I cannot find a working example, just about everything I've found on the web will not compile, which probably means that I am doing something wrong, but unfortunately I'm not sure what it is, so I need this first example spoon fed to me. If I can compile and revert back if I break something, I'll be able to learn quickly that way.
Sadly enough, I'm not even able to get the msdn to work
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx[^]
Any help in helping me build a decent foundation of understanding the syntax of this would be greatly appreciated.
|
|
|
|
|
You did find the right web site, now you need to learn and use the search facilities.
Please look here[^].
|
|
|
|
|
Hi,
I found Wesley Browns through the search and that didn't compile and that's when I decided to seek help through the forum as I figured I was doing something fundamentally wrong.
I will parse through the other search results if you think I will have success with another result.
Thanks for the reply.
|
|
|
|
|
Three comments:
1.
don't say "it does not work" or "it does not compile", be specific. Tell us what tools you are using, and what the first (and second) error messages are saying.
2.
Look at the line numbers; they are there to help you out. If you want to be a programmer, you must learn to help yourself. Asking in a forum like this one is fine as a second option, not really as a first.
3.
Each CP article has its own forum where you can find other people's comments on the article, could be quite interesting; and where you can add yours. Adding a "New message" will signal the article's author, so you might get HIS response to your troubles, something you are not likely to get here.
|
|
|
|
|
Ok
I am using c# 2008 express. I'll use Wesley Browns code as an example. I try and open the pingtest.sln file and 2008 express tells me I have to convert it. I back up the original and convert. On the right hand side of 2008EE I see 2 projects
I press start without debugging and I get "A project with an Output Type of Class Library cannot be started directly .... "
This is a different error then what I have seen with other projects I have found on the web, but it stops me from going further none the less.
C# Ping Component[^]
|
|
|
|
|
You said there are two projects. I suspect, though I haven't looked at the article you're talking about, that one project is a class library and the other is a Windows Forms exectuable. Right click the other project and pick "Set as Startup". Then try and launch it.
|
|
|
|
|
you can build each project separately, or the entire solution at once.
however you can not run a DLL, the only thing you can run is a project that leads up to an EXE file. So make the right project the "startup project" (right-click in solution pane), and there you go.
this your problem is not related to programming, it is you not being familiar with Visual Studio. That takes some time.
|
|
|
|
|
David, Luc
You were both correct, thank you! I'm going to start watching tutorial videos on c# and 2008 express in a minute based on your observations.
You are right, I am having trouble with Visual Studio ... now that I can compile one of the projects, I can't even find where the code is that goes into this project
|
|
|
|
|
You're welcome.
Enjoy your Visual adventures!
|
|
|
|
|
How to create a master page in C# ?................
|
|
|
|
|
You don't create it in C# - you create it in Visual Studio by selecting the appropriate project type in the "New Solution" dialog box.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Not a project type ,
Right Click on your Website not "Solution Explorer" and Select "New Item" and a Dialog box will appear and select master page. For more info on that look at this
http://www.devx.com/dotnet/Article/18042[^]
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
How can i Automate a usercontrol using UIAutomation class
please advice
thnks in advance
|
|
|
|
|
You can start your research by reading this[^]. Then just follow the links and keep reading. You've got a lot of work to do.
|
|
|
|
|
Hi,
I will need to write a C# program that will show the user has access https webpage.
What I mean is that when a user type something at the URL.
The program will do a check.
Check whether is it https url.
If yes, the program will do a output.
Then pipe out to a txt file.
Output will be something like :
URL: https://www.gmail.com/
Time: 0100hrs 20-Nov-2010
If not then the program will skip it.
|
|
|
|
|
Okay, you have your program specification. What was your question?
|
|
|
|
|
How to code it?
I am a newbie.
|
|
|
|
|
If you really have no idea how to write such a program I suggest you get a book on C# or try some of the online resources, this[^] is an excellent primer, and start form there.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I'm sorry, but that's not the way Code Project works. We don't write applications for people - we're all volunteers here and we don't have time to write full apps for others. If this is a personal project, I'd take a look at doing something simpler for a start.
I will say that you are missing several key pieces of information here - how do you intend to interact with the browser? Is it going to be an add-in? Are you intending to hook into the browser instance from a service? Which browser are you intending to target? You need to answer these questions before you can even begin to code this task.
|
|
|
|
|
Right now only Firefox.
But if i can interact with all browser would be better.
I just wanna get the URL address that is HTTPS thats all.
|
|
|
|
|
Why? What are you trying to accomplish? How are you trying to run it - in the browser or out of the browser? If you're trying to run it in the browser then you can't use C# for it - Firefox runs on different platforms, so you need to write the extension in a manner that would run on multiple platforms.
|
|
|
|
|
I want to run outside the browser.
I just wanna check whether is the user access https pages.
if yes output into a txt file.
how to do it?
|
|
|
|