|
Thanks a lot.. can i also cast like using the java syntax like
"Button b = (Button) sender" <--- is that possible?
|
|
|
|
|
Silvyster wrote: is that possible?
Did you try it? What happened?
|
|
|
|
|
hy everyone!
i would like to start a project in programming a webservice which does some tasks.
but because i have done none before i do not really know where or what to start with. does anyone of you have links, helpful infos or a "best practice" to help me start with? something like a cookbook, which describes how or where to start, if you want to do it the first time?
because i guess it's better to fetch many useful hints instead of just trying things and to get frustrated because it doesn't work as expected
thanks for any useful hint!
stephan.
|
|
|
|
|
Start with small projects and keep with the basics.
Just because we can; does not mean we should.
|
|
|
|
|
Start here: http://support.microsoft.com/kb/308359[^]
It's pretty simple. Create an .asmx page in a webproject, go to the code behind and add a method. Decorate the method with the attribute [WebMethod] and make sure you're only using simple types as parameters. Set you asmx as the start page of your project and hit F5. You should be able to test your method from Internet Explorer.
Regards,
Rob Philpott.
|
|
|
|
|
Hello,
I currently have a form that reads through an xml file and displays information based on the object selected in the combobox.
I can read the information from the xml just fine, but editing and saving the information is where I'm having trouble at.
xml file:
<Objects>
<Object name="Square">
<Height>15</Height>
<Width>15</Width>
<Color>red</Color>
<Object name="Circle">
<Radius>10</Radius>
<Hollow>True</Hollow>
<HollowRadius>5</HollowRadius>
<Color>blue</Color>
</Objects>
How would I change the "Sqaure" objects height value?
or
How would I change the "Circle" objects hollow value to false?
Thanks
|
|
|
|
|
<br />
using System.Xml;<br />
<br />
public void ChangeObjectHeight(string Name, int Height)<br />
{<br />
XmlDocument Doc = new XmlDocument();<br />
Doc.Load("yourfilenamehere.xml");<br />
<br />
XmlNode Node = Doc.SelectSingleNode("/Objects/Object[@name='" + Name + "']");<br />
XmlNode Node2 = Node.SelectSingleNode("Height");<br />
Node2.InnerText = Height;<br />
<br />
Doc.Save("someplacetosavetheshit.xml");<br />
}<br />
or something to that extent.
|
|
|
|
|
Thanks very much, you rock!
|
|
|
|
|
Really? String concatenation? And multiple queries? That's how it's done?
string xpath = string.Format("/Objects/Object[@name='{0}']/Height", Name);<br />
Doc.SelectSingleNode(xpath).InnerText = Height.ToString();
led mike
|
|
|
|
|
Stupefy wrote: that reads through an xml file
How?
Also your XML is not valid so until you fix that it will be difficult to help you.
led mike
|
|
|
|
|
Hello all.
Now that I have discovered extension methods, I am revisiting my libraries of handy-dandy routines to see where it makes sense to convert them. In doing so I am also revisiting a question about how to handle methods that work on different data types.
I am wondering if anyone out there has any opinions or knows any arguments for/against writing such methods in a particular style. I know there probably isn't any one "right" answer, but I thought it would be informative to hear what other programmers think.
For instance, I have a lot of methods that work on strings. I also need the same operations to work on character arrays. So I might end up with something like
public int foo ( char[] SourceData ) { ... }
public int foo ( string SourceData ) { ... }
I have also handled this using
public int foo ( char[] SourceData ) { return foo(new string(SourceData)); }
public int foo ( string SourceData ) { ... }
and even
public int foo ( object SourceData )
{
string source;
if ( SourceData.GetType() == typeof(string) ) source = SourceData;
else if ( SourceData.GetType() == typeof(char[]) ) source = new string(SourceData);
else error_condition;
...
}
I started to look at generics, but it seems that they may be a bit of overkill for routines that only handle 2 or 3 different data types.
Opinions? Critisisms? Other ideas? All are welcome.
Clive Pottinger
Victoria, BC
|
|
|
|
|
cpotting wrote: I started to look at generics, but it seems that they may be a bit of overkill for routines that only handle 2 or 3 different data types.
Why would generics be overkill. Just because you are limiting to only 2 or 3 data types, generics are still very useful. Let's face it, generics (in most cases) are often only used against a couple of types only. Don't limit yourself just because your code doesn't use every possible type.
|
|
|
|
|
Pete O'Hanlon wrote: Don't limit yourself
He may not be.
led mike
|
|
|
|
|
led mike wrote: He may not be.
Smooth. You've definitely mastered the one liner.
|
|
|
|
|
Thanks Pete. I will take a look a closer look at generics.
I'm not quite sure what led mike meant by "He may not be", though.
Clive Pottinger
Victoria, BC
|
|
|
|
|
Well I've had two years of learning from some of the best
led mike
|
|
|
|
|
I'm trying to figure out a way to set a tooltip for each individual ColumnHeader on a ListView. Unfortunately, ListView can't extend ColumnHeader by default, at least that's what ToolTip.CanExtend(object) reports when I try to run it on an instance of ColumnHeader.
I was wondering if anyone could point me in the right direction for this. After doing a Google search I found a few message board postings where WndProc was overloaded on the ListView control butall were too vague or used types they didn't define.
I know column headers in DataGridView are able to handle ToolTips so I'm going to take a look at that via reflector. Hopefully, that'll shed some light on what I need to do.
-JC
|
|
|
|
|
Hi All,
I want to display the sum of the values of a field on my report.
im using 'Running total fields' , then i select the field, bud i don't see the 'Sum' selection on the 'Type of summery' combobox...anyone any idea???
Thanx.
|
|
|
|
|
Try adding a formula field and setting its value to the sum of the field you're looking for.
So the formula text would be something like:
Sum ({Table.Fieldname})
The Sum function also allows you to set specific criteria on what to count. I'm not sure how flexible it is, but it's there.
-JC
|
|
|
|
|
hello allll
i have assingned a task to recognise the image that is a mathematical number 0,1,2,3,4,5,6,7,8,9
using image processing
plz any one guide me through this whole process and regard me code
if anyone have
i have to use c# plz guide me for the C# tooo
waiting for replys
thanks
|
|
|
|
|
Read the first message in the forum titled "How to get an answer to your question", pay attention to item #2
Then after you have done that, go to the articles on this site and you will find a series on C# Image Processing. You will find the articles under the "Chapters" menu item.
led mike
|
|
|
|
|
Obviously you're too stupid and lazy to handle the task. Try doing something you can handle, like sweeping streets or selling fruits.
No one is going to guide you through any process or give you C# code.
Idiot
|
|
|
|
|
B.Tanner wrote: Try doing something you can handle, like sweeping streets or selling fruits.
LMAO gotta add that to my CPHog quote list
Try doing something you can handle, like sweeping streets or selling fruits.
B.Tanner - the C# forum
|
|
|
|
|
O Mr. hello i was just askig for the guidence and as you cant do this
so please shut up as you dont know I am lazy or not.
assinging me the task means some one has confidence on me.
Ok and if you dont have manners to rply then please dnt trouble yourself anymore to rply again.
I am very much new to image processing and asking help in this regard .
IDIOT
|
|
|
|
|
Hi there,
I want to extract the image src from the image tags in HTML files
::HTML Text::
<button class="toolbar" style="height:26px;width:22px" onclick="return InsertText(' ');"><img src="http://www.codeproject.com/" alt="Insert a smile" border="0" width="16" ></button>
::Output String::
http://www.codeproject.com/
Thanks
|
|
|
|