|
you're welcome.
For completeness sake, I'm posting a snippet about it:
void defValues(DataTable dt)
{
foreach (DataColumn dc in dt.Columns)
{
switch (dc.DataType.ToString())
{
case "System.DateTime":
dc.DefaultValue = DEFAULT_DT;
break;
case "System.Boolean":
dc.DefaultValue = false;
break;
default:
break;
}
}
}
|
|
|
|
|
hi pleas help
I want to convert a string to an System.Windows.Forms.HtmlDocument object.
Is there a way to go about it?
Thank you very much.
WebClient myClient = new WebClient();
string webPageString = myClient.DownloadString(Url);
modified on Monday, March 14, 2011 7:20 AM
|
|
|
|
|
rather than WebClient, use WebRequest.GetResponse() or use a WebBrowser.Document
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
thank you
i dont use webbrowser because speed low
How to use WebRequest.GetResponse() Scale is explained
Please
|
|
|
|
|
you could google the methods/class names I provided.
you would then find things such as this[^].
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Alternatively, he could just view the link I put in. It seems that he's too tired to move the mouse down the screen enough to open up the URL where I directed him to the answer.
|
|
|
|
|
It looks like we have a long week ahead of us...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: It looks like we have a long week ahead of us...
Doesn't it just. You try to help them, but they just can't quite take that next step themselves.
|
|
|
|
|
well, someone managed to move the mouse all the way to the 1-vote. My mouse is heavier though.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Unfortunately I could not find
return WebRequest.GetResponse() as HtmlDocument
|
|
|
|
|
Use the Write[^] method of the HtmlDocument class taking care to follow the recommendations to use OpenNew first.
|
|
|
|
|
I have a project about the media player(wav file),which must show the play progress.
Now i can get the total play time(264s).
my method is using "timer".
The progressbar.value+1 per second.when the file play end,the progressbar's value=time.
Because of the timer control is imprecise,so the file play end and the progressbar is not come to the end .
so ,how can i get a precise prgressbar.
thank you very much!
|
|
|
|
|
Do it by percentage of time.
ie 264 seconds is 100%, so 1 second is 0.38%, so just increment by that value each second.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
|
maybe you can store your start time, and in each timer event you can calculate the EXACT timespan, and then set the according value of the progressbar
I cannot remember: What did I before google?
|
|
|
|
|
|
songguohui wrote: the timer control is imprecise
for one Hertz events, the timer classes are more than adequate, however maybe your code is not; as Thomas said, you should not accumulate errors, better is to recalculate the current situation every time without accumulation.
if you want to know more about timers, you may be interested in Timer surprises, and how to avoid them[^].
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
The progress bar is as precise as you make it, the trick is to start with the following:
progressBar.Minimum = 0;
progressBar.Maximum = mediaPlayer.PlayTime;
progressBar.Value = 0;
If the wave player measures in milliseconds, all the better, you will get a more accurate bar.Update the progress bar more often if you want better resolution (say every 100ms), this won't effect performance unduly with the timer. You should be able to do the following on each tick:
progressBar.Value = mediaPlayer.CurrentTime;
If such a property does not exist on the class you are using to play the wav file, you will have to increment by the tick amount. The media player class probably has and event for the player finishing, if so you should call progressBar.Value = mediaPlayer.CurrentTime; when this event is fired, or just set it to the "PlayTime" property, this will fix you initial problem.
Finally, if the player is paused, you should stop the timer and set the current time again. One suggestion is to use a slider instead so the user can move through the file, obivously you will need to be able to set the current time to do this.
|
|
|
|
|
|
|
Hi
How can I change Excel setting after exporting table from C# into it from C# running Asp Program
|
|
|
|
|
If you're saving the table into a .xslx file, you could directly manipulate it (it's just XML that matches the Excel schema) and change the setting directly.
|
|
|
|
|
below string is saved in database.
<people>
<user>
<id>1</id>
<name>홍</name>
</user>
<user>
<id>2</id>
<name>김</name>
</user>
</people>
I want to read xml's contents by using XmlTextReader.
but There is no xml file just saved into database.
How can i read?
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|