|
Message Closed
modified 23-Nov-14 6:20am.
|
|
|
|
|
There is no any domain in my company.
|
|
|
|
|
Then you will have to use netapi32.dll
look here: article
|
|
|
|
|
Hi all, How to create xmpp client using C#? Can anybody help me I just need that client to talk(chat) with xmpp server like jabber etc.
|
|
|
|
|
choose a single forum to ask your question, and stick to it.
|
|
|
|
|
Hi,
I have the following RSS Feed containing a CDATA Tag. I wish to get the "img src" attribute information, but i am unable to get it. Can anybody help please !!!.
I am using LINQ to XML. Please give LINQ solutions only...
<description><![CDATA[
><img src="http://l.yimg.com/a/i/us/we/52/30.gif"/><br />
<b>Current Conditions:</b><br />
Partly Cloudy, 37 C<BR />
<BR /><b>Forecast:</b><BR />
Fri - Sunny/Wind. High: 39 Low: 25<br />
Sat - Sunny/Wind. High: 42 Low: 26<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Islamabad__PK/*http://weather.yahoo.com/forecast/PKXX0006_c.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
]]></description>
Thank you in advance...
|
|
|
|
|
Just access the RSS feed(XML content) in your dataset , after getting in your dataset you can do wat ever you want.
|
|
|
|
|
If you guide me a bit further...
1. I have loaded the document as follows.
XDocument rssFeed = XDocument.Load(sForecastUrl);
2. Now i get the descendant nodes as follows
var desc = from e in rssFeed.Descendants("channel").Descendants("item").Descendants("description")
select e;
foreach (var element in desc)
{
element.Value;
}
I am able to get description element value which contains the cdata tag.
Dont know what to do next to get "Img Src" attribute directly rather than from string manipulation.
Some code in the foreach loop should help please.
|
|
|
|
|
No No...
Get the XML and convert the XML to DATASET using dataset.readxml() you will get all tags as columns and its attributes , so you can easily get the attribute value.
|
|
|
|
|
Oh!!!
I understood your point on using datasets, but i have written all my work using linq to xml. i have successfully parsed whole of the xml document already, only part missing was this cdata tag, so i was asking for finding a solution to that using linq as well. i don't want to load the complete document as dataset again, i have already loaded the webresponse into xDocument. So any solution relating to that...
Even though i can get the url out from the attribute using string manipulation but clearly that is not the right method.
P.s. Thanks for the dataset option though....
|
|
|
|
|
Hai
My USB device is communicating with my C# application once in 500ms and exchanging data(Using a timer and interrupt transfer.) So far seems Ok.
If my device is abruptly removed,(I think)windows 'device removal' message arrives only after removal is complete. But my application tries to write to my device in the meantime and throws an exception . The write is failed - I tried by stopping next transfers but still exception throws with some other message.
I have a try catch statement block.
If a USB 'device write' failed as handle is no longer valid or present how should we tackle the exception and save the application from crashing?
Thanks
With Regards
Roy Thomas
"..this file is known as source file probably because it is a source of frustration and anxiety!" - Chuck Sphar - In book 'C# 2005 for Dummies'.
|
|
|
|
|
pulbic class A
{
public void func1()
{
}
....
}
public class B : A
{
...
}
How to let user not use the func of class B
The keyword new is only hide the old function but new a new method func.
|
|
|
|
|
yes
Hints: virtual, new
I bug
|
|
|
|
|
No. You could make it throw an Exception. But what you are trying to accomplish is a bad design; B probably shouldn't derive from A at all.
|
|
|
|
|
I would say that's not always the case. Sometimes, you may want to create a class that has most of its base class' functionality, but not allow derived classes access to the base class' version of a given method. I've never personally run into a situation like that, but I could see it happening.
.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
|
|
|
|
|
It happens all the time when deriving from System.Windows.Forms.Control for instance. In fact most (if not all) of the controls provided hide some base methods and properties.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hide them so they can't be used/accessed?
|
|
|
|
|
MS do it all the time - they mark them as Obselete , throw NotSupportedException s as well as the standard EditorBrowsableState.Never and Browsable(false) etc... I agree - against OOP principles but as they included so much functionality in such classes there is little choice.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
That violates basic OOP principles.
|
|
|
|
|
Yeah, I suppose it does, and like I said, I've never done it myself, but that wasn't really the guy's question.
.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
|
|
|
|
|
If you mark it as obselete then it cannot be used.
If it is in a separate assembly that is added as a reference to the dll (not a project reference) then the EditorBrowsable attribute will hide it so it doesn't show in intellisense.
[EditorBrowsable(EditorBrowsableState.Never),
Obsolete("This method is obselete")]
public new void Func()
{ }
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hello,
I am trying to create a script that will list the tables in an Access database and put them into a list box. The code I am using (below) seems to be correct as far as it goes, but instead of listing the name of the tables, it returns the following string for each row[System.Data.DataRow]. I am obviously missing something here. Any suggestions are appreciated. Thank You, Pat
string Constr = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source= " + Application.StartupPath + @"/" +
textBoxAccessFile.Text + ";Jet OLEDB:Database Password= " + textBoxAccessPassword.Text;
OleDbConnection Conn = new OleDbConnection(Constr);
try
{
Conn.Open();
DataTable dt = Conn.GetSchema("tables");
Conn.Close();
for (int i = 0; i < dt.Rows.Count; i++)
{
listViewDbTables.Items.Add(dt.Rows[i].ToString());
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
|
|
|
|
|
It make sence to have that result because you are calling the ToSting() on a DataRow object and
it returns the type of the object eg System.Data.DataRow
Have a look here.
I bug
|
|
|
|
|
Yes, I saw several examples there, but they were all different and I did not know which one to use. I tried 2 of them and could not get them to work. Finally, I used part of the code from another reply with your suggestion and I got it to work correctly. I have posted the finished code in the other reply in case you, or others, would like to see it. Thank you for your assistance. I am marking your reply as a good answer as well since it sent me to the right spot and helped me to derive the working code. Thank you, Pat
|
|
|
|
|
listViewDbTables.Items.Add(dt.Rows[i].ToString());
I guess you want to retrieve the value:
dt.Rows[i][?].ToString(), ? should be int or string.
|
|
|
|