For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
There are two ways of doing this through a single process called a SnapShot.
1. You can capture your entire display area, or
2. by defining a rectangular area on the display area called the ROI (Region Of Interest)
There are lots of code samples out there that covers both scenarios. Use Google to search for "How to take a snapshot of my display" or "How to capture an area of my screen".
You can then save the memory stream (the captured information will be stored in a memory stream) in a few formats - JPG, TIFF, PNG and BMP.
I have a program created by me which I've been using for some time now. It's a tool for android and ios. I want to make it so if there is a connected android or ios device on my computer my program will automatically detect it but unfortunately where to start. I've been searching all over Google and found nothing of use. For example when the device is connected my label1 text will say something along the lines of "ios device connected"
Presumably your wrote this tool. And presumably it already does something with both devices.
So why can't you just find a do nothing API for each device, such as a query for version number, and put that in a thread that polls every X seconds. If it gets a result then the device is there. If no result then the device isn't.
Regarding Out-of-Office-Replies, let me tell a bad story.
Someday, a customer told us they could not receive emails from our company. They found out that the emails were blocked due to some spam filter rules. Somewhere in their spma-checking chain, they used a blacklist from spamhaus. And our company was listed there as a sender of spam.
How did we get there?
Some spammer sent an email to a colleague. Because she was on holiday, an Out-of-Office-Reply was sent to the "sender" of that email. But the "sender" was forged: it was a honey-pot address of spamhaus. Great!
Well, I do not know the further steps taken then to recover our status as a non-spammer - having analysed the situation to that point, I forwarded the issue to higher management. I do not know if they paid the money normally required by spamhaus or if they could convince spamhaus that the spam originated from some other place.
Anyway, since that time I suggest not to use spamhaus, and not to use Out-of-Office-replies either.
But who cares about that experience?
I seem to be having problems when trying to run the shared sub from another class in my form1 application. The code works flawless when its called directly but when i try to multi thread the controls on form1 will not update.
The shared function and sub
PublicSharedFunction FileCount(PathName AsString) AsLongTryDim FSO AsNew FileSystemObject
Dim fld As Folder
If FSO.FolderExists(PathName) Then
fld = FSO.GetFolder(PathName)
FileCount = fld.Files.Count
Catch ex As DirectoryNotFoundException
EndTryEndFunction'Calculate File Count
PublicSharedSub StartNewScan(ByVal FilePath AsString)
Dim Allfile AsString = "*.*"Dim FFcount AsLongDim MyFolderSize AsLongDim FullPath AsStringUsing fse AsNew FindFiles.FileSystemEnumerator(FilePath, Allfile, True)
Dim ien As IEnumerator(Of FileInfo) = fse.Matches().GetEnumerator()
ForEach fi As FileInfo In fse.Matches()
FFcount += CStr(FileCount(fi.DirectoryName)).Length
Form1.Label3.Text = CStr( "File Count:" & FFcount)
MyFolderSize += fi.Length
FullPath = fi.FullName
Form1.Label4.Text = "File Path:" & FullPath
I am trying to call the shared sub in form1 like so
Dim StartSharedSub asnew threading.thread(addressof Startnewscan)
I am aware of delegates and that it may be necessary in my case to use that to update my UI controls but I am confused how to implement it in my case.