|
michaelgr1 wrote: I need to write an event (or method) that will be raised once a day at a particular time (5PM)
Do you want your application to run all the time? If yes, you need a thread which checks the time frequently and do job when it is 5PM. If you don't want to run this application all the time, efficient method would be to schedule this application using windows scheduler.
|
|
|
|
|
No,
The application will work all the time and only at 5pm it will raise the method.
Do i have to check every for example couple of minutes if it's 5PM and it will raise the method or is there other way?
|
|
|
|
|
The application does something else (can do many things) ,
But i want the event will raise only once a day at 5PM .
Is there a way to do it not using a code that will check every some time for the current hour and will raise the event (method) only at the particular time?
|
|
|
|
|
You can create a timer, and set the time interval to be 5 PM - current time. You would have to do that again in the timer callback as well.
|
|
|
|
|
Hello Friends
My application wants to download Folder(folder and sub folders with files) from Web Server using HTTP. Can guide me to do this.
Downloading from FTP is done, for that I have used FtpwebRequest and FtpWebResponse...
But how to download using HttpWebRequest...
I have able to download a file from WebServer but I want to download a folder and files.
Thanks in advance...
|
|
|
|
|
You don't download folders. You have to create them, download files and put into the created folder. Of course, a recursive function is required which can travel through the directories and sub directories.
|
|
|
|
|
Ok..but how to get list of files and folders available on WebServer.
like FTP we can get list of Directories and files using "WebRequestMethods.Ftp.ListDirectory ;"
|
|
|
|
|
Hello,
I have created word document using Microsoft.Interop Library,for that i have to insert text which is contain html tags,now i need to formatt that text and putup that html text on word document,means need to put up html formatted text on word document using c#.
Thanks,
nikunj padaliya
modified on Tuesday, May 26, 2009 12:44 AM
|
|
|
|
|
it is late answer i know ))
Create a word doc, and insert a bookmark into that, then you can paste your string to that bookmarked place wit trhe code below
private void button2_Click(object sender, EventArgs e)
{
WordApp = new Word.ApplicationClass();
fileName = @"yourworddocname";
Microsoft.Office.Interop.Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref Format, ref realencode, ref isVisible, ref missing, ref missing, ref missing, ref missing);
WordApp.Visible = true;
WordApp.Visible = true;
bookmarkdene(aDoc, "yourbookmarinworddoc", yaz);
}
private static string HtmlClipboardData(string html)
{
StringBuilder sb = new StringBuilder();
Encoding encoding = Encoding.GetEncoding("utf-8");
string Header = @"
Version: 1.0
StartHTML: {0:000000}
EndHTML: {1:000000}
StartFragment: {2:000000}
EndFragment: {3:000000}
";
string HtmlPrefix = @"
!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//TR""
html
head
meta http-equiv=Content-Type content=""text/html; charset={0}""
head
body
!--StartFragment--
";
HtmlPrefix = string.Format(HtmlPrefix, encoding.WebName);
string HtmlSuffix = @"
<!--EndFragment-->
</body>
</html>
";
// Get lengths of chunks
int HeaderLength = encoding.GetByteCount(Header);
HeaderLength -= 16; // extra formatting characters {0:000000}
int PrefixLength = encoding.GetByteCount(HtmlPrefix);
int HtmlLength = encoding.GetByteCount(html);
int SuffixLength = encoding.GetByteCount(HtmlSuffix);
// Determine locations of chunks
int StartHtml = HeaderLength;
int StartFragment = StartHtml + PrefixLength;
int EndFragment = StartFragment + HtmlLength;
int EndHtml = EndFragment + SuffixLength;
// Build the data
sb.AppendFormat(Header, StartHtml, EndHtml, StartFragment, EndFragment);
sb.Append(HtmlPrefix);
sb.Append(html);
sb.Append(HtmlSuffix);
MessageBox.Show(sb.ToString());
//Console.WriteLine(sb.ToString());
return sb.ToString();
}
public void bookmarkdene(Word.Document aDoc, string bookmarkName, string yourhtmlstring)
{
try
{
object bookmark = bookmarkAdi;
object missing = System.Reflection.Missing.Value;
object pasteType = Word.WdPasteDataType.wdPasteHTML;
DataObject clipDO = new DataObject();
if (aDoc.Bookmarks.Exists(bookmark.ToString()))
{
Word.Range rangeTbl = aDoc.Bookmarks.get_Item(ref bookmark).Range;
clipDO.SetData(DataFormats.Html,HtmlClipboardData(yourhtmlstring));
Clipboard.SetDataObject(clipDO, true);
rangeTbl.PasteSpecial(ref missing, ref missing, ref missing, ref missing, ref pasteType, ref missing, ref missing);
}
else
{
}
}
catch (Exception exc)
{
MessageBox.Show(exc.Message);
}
}
thanks for everything i have...
|
|
|
|
|
Hi,
I am intending to write a simple OCR engine. How should I go about doing it? Are there any source codes available for me to use and alter it according to my need? I am a newbie to this OCR thingy. Pls help.
Please reply at e-mail: phoiphapham@gmail.com
|
|
|
|
|
First thing you do is some research clickety[^] amazing stuff the interweb
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Search the articles for "OCR". One of the better examples I've seen is this article[^].
BTW, there is no such thing as a "simple" OCR Engine. Unless, of course, you find neural networks "simple".
Phoiphapham wrote: Please reply at e-mail: phoiphapham@gmail.com
The only people who want to see your email address are spammers. Noone here is going to reply to your email address. All answers are posted here so that future readers will see the answer too, not just you.
|
|
|
|
|
I'm sorry, this's the first times i post question at here.
Now, i don't know the way to implement a neuron network on computer.
do i use Matlab?
please help me.
|
|
|
|
|
Start Googling for "Neural Network". There is way too much information to stick into a couple of forum posts. Also, I already gave you a link to an article here at CP that does exactly what you specified. All you have to do is click on the link in my first response to you.
No, I don't use MatLab.
|
|
|
|
|
Phoiphapham wrote: Are there any source codes available for me to use and alter it according to my need?
What special need could you have ? How is this the same as writing an OCR library ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I special need the way to implement a NN into computer and to training it.
thanks.
|
|
|
|
|
Hello Coders;
Updating a VB.Net 2003 to C#.Net 2008 I found that in a treeview they were using Send.Key ^C to cut, ^V to paste etc the nodes.
I have tried to implement the same in C# 2008 and its not working so I have been scouring the net for an example of how to Cut, Copy and paste TreeNodes and haven't found any useful info.
Can someone point me in the right direction?
tia
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Rafone wrote: ^C to cut, ^V
yep, that's VB for you. Instead of implementing a context menu they use sendkey - probably left over from a VB6 implementation.
Use a context menu on the treeview
Cut - copy node to a holding variable and delete from the tree
Copy - sames as cut without the delete
Paste - copy the node from the holding variable to the selectred node
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
they used send.key from a context menu.
The original app was written in VB.Net using VS2003. In fact after upgrading the app to VS 2008 the cut copy paste of tree nodes works great, I just can't get these methods to work in C# VS2008.
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
the class connection that i made (and everybody is using for connections), it's freezing the server after time. maybe my code is wrong or anybody isn't using 'dispose' function.
i need to know what is happening with...
help me please i need to see the objects with a tool for that.
sorry for bad english.
|
|
|
|
|
I have a class Input that has a static property Input[] Devices .
Instead of the user having to iterate over the array and subscribe to an event in each instance, I want to provide a mechanism where they can do it in one shot.
This works, but I wondered if there was a better way?
public class Input
{
public event EventHandler<ConnectedEventArgs> Connected;
public static Input[] Devices
{
get
{
}
}
public static void SubscribeToAllConnected(EventHandler<ConnectedEventArgs> multicastDelegate)
{
foreach (Input device in Devices)
device.Connected += multicastDelegate;
}
public static void UnsubscribeToAllConnected(EventHandler<ConnectedEventArgs> multicastDelegate)
{
foreach (Input device in Devices)
device.Connected -= multicastDelegate;
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Can you change the devices property to a method? Assuming you keep the devices in a private variable devices , you can write something like
public static Input[] Devices(EventHandler<ConnectedEventArgs> multicastDelegate)
{
foreach (Input device in devices)
device.Connected += multicastDelegate;
return devices;
}
|
|
|
|
|
Hmmm... not a bad idea. In the real world class there are quite a few events so I could overload the method and have different parameters, but many have the same signature EventHandler so not practical.
I'm trying out VS2010 and C#4.0, so I could use optional parameters
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi.
I am making example:users do not press ctrl+alt+delete or LWinLogo press dont open start bar in the form Iam what do ?
|
|
|
|
|
For Christ's sake, man, a simple search on the internet will find loads of examples - try to help yourself before asking others to help you!
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|