|
Now i using VS 2003 and tapi3.x to program.
i think with tapi3 i can play back wave file , but i find that all the sample playback file in MSDN write in C++ . I don't know how to do that in C# .
If you know please help me .
thanks
|
|
|
|
|
And i dont mean a list of processes, like if you had explorer running, looking at drive c, the task name would be DRIVE_C(C , and of course the process would be explorer.
|
|
|
|
|
Hi there!
I'm using the XmlTextReader to parse an XML file. The structure of the file is as follows:
+++
<?xml version="1.0" encoding="utf-8" ?>
<slideshow title="My Slideshow">
<image url="imgurl_1" copyright="copy_1" contact="contact_1">
<en-US>
<title>title_1</title>
<description>desc_1</description>
</en-US>
<de-DE>
<title>titel_1</title>
<description>beschreibung_1</description>
</de-DE>
</image>
</slideshow>
+++
There might be any number of image and language (e.g. fr-FR) nodes in the file.
What I'm trying to do is to find a certain language (e.g. 'de-DE') node. If the node can't be found, I'd like to find a different one (fallback language). But can this be done using the XmlTextReader? I can't seem to figure out how to simply check a node for its title and move on if there is no match. Or do I have to use an entirely different approach?
Thanks in advance and a happy sunday!
/matthias
<br><div style="{width:100%; color:navy; background-color:white;border-top:navy 1pt solid;}"><font size="1">I love deadlines. I like the whooshing sound they make as they fly by. <br>[Douglas Adams]
|
|
|
|
|
Hiya,
XmlTextReader provides a forward-only way of parsing xml documents. This means you don't have random access ability and the means to jump around your xml document. You start at the top and work your way to the end.
With this in mind, if you want a 'fallback' language in your example, you either need to provide this as the last entry in the xml, or else implement a way of parsing which remembers the 'best yet' record from the xml.
Two points about your xml, firstly probably just a typo but the </image> tag doesn't match <img> tag, and secondly you are using the language as the element name <en-US> - this might be better represented as <language name=en-US>.
You can use XmlTextReader.Read() to fetch the next element from the document. Check its NodeType property to determine if it is Element . Then using your xml as it stands you can use the Name property to pick up the element name. From there you can have a boolean flag which you set to tell you're in the right language and can read the title and description.
Hope that makes some sense...
Regards,
Rob Philpott.
|
|
|
|
|
Hi Rob,
thanks for your reply. I've had a look closely last night at the XmlTextReader and figured, that it was not the right thing to use. Switched to the XmlDocument instead for increased flexibility. As for your suggestion to use the language codes (like en-US ) as attribute values, I've done that. Makes perfectly sense.
Thanks for your help! I really appreciated it.
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
I want to set backgroundimage of a MDIForm through coding. So I set it with the help of openfiledialog.
But the problem I m facing is that, it is not in center, the image get "tiled" (many same images on the form) I want only 1 image and it must be in center of the form.
Another problem is that I want to see this BackGroundimage after restarting the application. (I don't want to store the image path in the database)
Please help me out.....
Thanx in advance
--
Harshal Bhakta
Pune
|
|
|
|
|
for the first problem, you will need draw the backgroundimage by yourself, override the paint event and calculate the bounds, draw it
the second, you can write it into registry, when application is starting, check the registry to determine whether the backgroundimage is selected.
|
|
|
|
|
Hi
Thank you for your quick response.
But I m still confused. I want to select the image as a background from the path (openfiledialog), and the image should at the center of the screen.
You wrote "draw the backgroundimage by yourself,override the paint event and calculate the bounds"
can u please tell me the code for it.
Second problem of saving the image: Next time when I run the application I must see the previously set background image. (I don't want to save the path in the database) you suggested abt registry..plz send code also for it.
please help........
|
|
|
|
|
see your email
|
|
|
|
|
i want to make a chronometer connected to the parallel port of the computer and i want to get some help if you have done any projcet like this,i have seen something about this in a forum so i decided to do this for my lesson project.it must iclude these;TLP521-4(Optocoupler), 74LS139 (Decoder), 74LS247(Display driver), 4 anode Display.
i am trying but i dont have enough knowlegde about displays,if you have any please help.
|
|
|
|
|
I can't understand,
If I have two form
One is form1
one is form2
how to set the button in form1 to open form2
|
|
|
|
|
If I understand you correctly, you want a button control on form1 to open form2?
In the Click event of your button, write some code like:
<br />
private void btnOpenForm_Click(object sender, EventArgs e)<br />
{<br />
Form2 myForm = new Form2();<br />
<br />
form2.Show();<br />
<br />
form2.ShowDialog(this);<br />
}<br />
I hope this helps.
Jeff Bramwell
|
|
|
|
|
i want to make a chronometer connected to the parallel port of the computer and i want to get some help if you have done any projcet like this,i have seen something about this in a forum so i decided to do this for my lesson project.it must iclude these;TLP521-4(Optocoupler), 74LS139 (Decoder), 74LS247(Display driver), 4 anode Display.
i am trying but i dont have enough knowlegde about displays,if you have any please help.
|
|
|
|
|
We need to display the data received from a csv stream in HTML format.
For this,we are thinking of importing into a dataset and binding a datagrid to the dataset.
Can someone provide the C# source of exactly how to go about it.
We DO NOT WANT to save the stream into a file,and then read through odbc;we would rather import the stream into a dataset directly
thanks in advance
|
|
|
|
|
If you just want to display it in HTML and don't need the DataGrid , you can do it the old fashioned way and parse the file using these rules.
- Write
<table> to your output stream - While your input stream has characters left:
- Read a line (or to the end) from your input stream.
- Write "" to your output stream.
- Replace all commas not inside a balanced set of quotation marks with
</td><td> .
- Replace all
</td><td>" with </td><td> . - Replace all
"</td><td> with </td><td> . - Replace all
"" with " . - If the first character of the line is
" , remove it. - If the last character of the line is
" , remove it. - Write the modified string to the output stream.
- Write "" to your output stream.
- Write
</table> to your output stream.
Now, you have a table with your CSV in it.
For example, following that replacement rule set with the string 1,2,3,4,"I say""Hello,"" and you don't","Com,ma" , we get the following replacements:
1,2,3,4,"I say""Hello,"" and you don't","Com,ma"
1</td><td>2</td><td>3</td><td>4</td><td>"I say""Hello,"" and you don't"</td><td>"Com,ma"
1</td><td>2</td><td>3</td><td>4</td><td>I say""Hello,"" and you don't"</td><td>Com,ma"
// Replace all "</td><td> with </td><td>.
1</td><td>2</td><td>3</td><td>4</td><td>I say""Hello,"" and you don't</td><td>Com,ma"
// Replace all "" with ".
1</td><td>2</td><td>3</td><td>4</td><td>I say"Hello," and you don't</td><td>Com,ma"
// If the first character of the line is ", remove it.
1</td><td>2</td><td>3</td><td>4</td><td>I say"Hello," and you don't</td><td>Com,ma"
// If the last character of the line is ", remove it.
1</td><td>2</td><td>3</td><td>4</td><td>I say"Hello," and you don't</td><td>Com,ma
"we must lose precision to make significant
statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi Friends
I made a project wich it has a form and I splited the form with 2 panel in the left hand I put a treeview control
Now I want to do these works:
When I click on one of the treeview nodes a related from or frame to that node display on right hand and these forms and frames are different from each other but the problem: there is only 1 method when you click on the treeview: private void treeView1_AfterSelect ( object sender, TreeViewEventArgs e )
I need to decicde on something that indicates which one of tree view nodes is selected.
If any of friends know how can I solve this problem please inform me.
thanks
FS.Hashemi
|
|
|
|
|
F. Hashemi,
Use the e.Node value that is provided by the event parameters. It will give you a reference to the clicked node.
Jeff Bramwell
|
|
|
|
|
I like to do a two-step process here.
1) When you create the TreeNode , set the Tag property with an identifier value that allows you to quickly ascertain the type of the TreeNode clicked. This could be as easy as using an Enum in your code.
2) As the previous poster suggested, use the TreeViewEventArgs.Node property to investigate the recently clicked TreeNode
You can refer to my article Building the CVS Root File Changing Utility here on codeproject.com for examples of using these properties together.
"we must lose precision to make significant
statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hey all,
I have DataRelation object between 2 tables & 2 DataGrids.
for some reasons, I delete the relation, activate an operation on the tables & then create the relation back. here is some code:
//before the operation starts:
Ds.Relations.Clear();
Ds.Tables["Cust2"].Constraints.Clear();
//after the operation
DataColumn dc1 = Ds.Tables["Cust1"].Columns["Id"];
DataColumn dc2 = Ds.Tables["Cust2"].Columns["Id"];
DataRelation Dr = New DataRelation("cust1to2", dc1, dc2);
Ds.Relations.Add(Dr);
everything is ok until now.
but when I tried to connect the tables to the datagrids:
DtGrd1.SetDataBinding(Ds, "Cust1");
DtGrd2.SetDataBinding(Ds, "Cust1.cust1to2");
I get the exception:
"Cannot have a relationship between tables in different DataSets"
does anyone know what is going on??
thanks
RoyRose
|
|
|
|
|
How can I maintain a strongly typed collection over a web service... when I try to access an item it turns out to be a generic object, and the type is generalized as an System.Object without its attributes/methods (even the ones specified as webmethod)
Its not allowing me to access any of the methods.
-Steven Hicks
CPACodeProjectAddict
-- modified at 2:16 Sunday 20th November, 2005
|
|
|
|
|
I am trying to recieve a couple of words out of an HTML web page. I have received the information and stored them in a string. How do I find and get everything after these words "Name:"?
Thanks for the help.
|
|
|
|
|
Name: (.*)
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have some CheckBoxes that I create at runtime and I need to iterate throught them. They are all named "TextBoxAuthorName1" "TextBoxAuthorName2" etc...
How can itterate through them in a for loop?
I think this might be called reflection, but i'm not sure..
i want to get their names, but i'm confused about how to do it...
|
|
|
|
|
Or is there a way to get all the controls on the webform and them filter out the TextBoxes and then filter them about again by their name?
/\ |_ E X E GG
|
|
|
|
|
An easy way to itinerate trough your TextBoxes without reflection is to get each contol you have in the collection that has the TextBoxes an check if it's name is the one you desire :
public void CheckContols() {
foreach(Control c in this.Controls) {
if(c.Name.StartsWith("TextBoxAuthorName")) {
}
}
}
Using reflection to do what you want is kind of like scratching your left ear with your right hand.
I hope you understand...because is a rough world out there...
|
|
|
|