|
Perhaps the OP obfuscated it for posting -- since this is about an SMS.
If it were not valid the second time, it would not have been valid the first time either -- and OP stated -- it worked the first time -- but not the second time.
|
|
|
|
|
I would advise you to examine very carefuly your use of the streams and the WebResponse -- also avoid trying to reuse them -- this is an inherently asynchronous process and trying to create an SMS bulk texting application is not what those classes are intended to do -- it is one thing to use them to mimic browser fetches, but quite another to use them statically for multiple texts.
At the very least, close them and get them each time -- the Response -- are you reading to the end and closing the response?
|
|
|
|
|
does anyone know if it is possible to sample an area of my screen,
eg every 5 second into my memory for it to be processed?
|
|
|
|
|
You're going to have to explain that in quite a bit more detail before you get any kind of useful answer.
"Sample"? Define that exactly and what you mean by "process".
|
|
|
|
|
hi,
sorry for being ambiguous.
what i meant was is it possible to sample the image being displayed on my monitor and process it.
eg if my monitor top left pixel is red then a message box will appear saying its red.
|
|
|
|
|
Possible, yes. It's quite easy to get a copy of any part of the screen as a Bitmap. Just use Graphics.CopyFromScreen[^].
|
|
|
|
|
Yes, it is.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
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.
|
|
|
|
|
Hi,
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"
|
|
|
|
|
AFAIK, there's no high-level library that can identify these. You could try and see if you can find them using WMI
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
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.
|
|
|
|
|
if you want the android to be connected why don't you just use adb cmd command on your program to make it easier?
to check if the device is connect "adb devices"
or you can try to search a dll "androidlib"?
everything is in the documentary how to use it.
|
|
|
|
|
Hi,
while reading buffer from TCP/IP continuously after some time i am getting this error.. could you please anyone help me to resolve it....
1.
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
Additional information: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
2.
An unhandled exception of type 'System.IO.IOException' occurred in System.dll
Additional information: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Regards,
Ganesh
|
|
|
|
|
Without seeing the relevant code it's impossible to tell you anything useful.
|
|
|
|
|
Greetings.
I would like to see your code, too but -- I can offer you some help anyway.
Always use try/catch for network communications and db access and ignore anyone that tells you not to -- unless it is your boss, but even then -- you should use it. I am saying this -- not to chastise you or puff myself up -- I am saying it because if you do you will not only learn how to fix this yourself -- you will learn to write code that can handle issues and also it will perform better. Generally, I will wrap most all of a function in try/catch if it involves communications or database access. You do not need it everywhere, just in key areas that warrant it.
If you ignore it altogether -- your application will halt because you did not use try/catch-- not good for anyone and not good for you. If you use try/catch -- at least you know that an error occurred and at least the code can exit gracefully instead of spitting out that page that tells your users that your code just died on them.
You said -- continuously -- but, the exception seems to be telling a different story. I suspect that your buffer read is either missing data that is in the buffer, or you are not servicing it often enough or -- your buffer is too small to begin with. TCP has some built-in defense against many errors, but it cannot force you to service the socket properly, so -- it is the buffer, the socket properties or your read code. How large is the expected data?
Mostly, guessing buffer sizes is a bad idea -- either you get one too small or you waste resources by making it too large. This is not a career where guessing is a good strategy and asynchronous communications demands that we code properly and not make assumptions.
|
|
|
|
|
|
|
Eddy Vluggen wrote: Try MSDN;
those are no OOF Rules... I'm looking for the rules to set forwardings, not for OOF settings...
|
|
|
|
|
Ah, my mistake.
Try MSDN[^] instead.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
that's not what I was looking for...
I'm looking for out of office rules, not inbox rules.
Difference is, that out of office rules are deactiveated autmaitcally once the user is back in the office...
|
|
|
|
|
Frosch11111 wrote: that's not what I was looking for... If it is using Exchange, then it will be on MSDN.
Frosch11111 wrote: Difference is, that out of office rules are deactiveated autmaitcally once the user is back in the office Would that be implemented as something special in Exchange, or would it simple be a rule that gets deleted when the user is back?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
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
Public Shared Function FileCount(PathName As String) As Long
Try
Dim FSO As New FileSystemObject
Dim fld As Folder
If FSO.FolderExists(PathName) Then
fld = FSO.GetFolder(PathName)
FileCount = fld.Files.Count
End If
Return FileCount
Catch ex As DirectoryNotFoundException
End Try
End Function
Public Shared Sub StartNewScan(ByVal FilePath As String)
Dim Allfile As String = "*.*"
Dim FFcount As Long
Dim MyFolderSize As Long
Dim FullPath As String
Using fse As New FindFiles.FileSystemEnumerator(FilePath, Allfile, True)
Dim ien As IEnumerator(Of FileInfo) = fse.Matches().GetEnumerator()
ien.Dispose()
For Each 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
Next
End Using
End Sub
I am trying to call the shared sub in form1 like so
Dim StartSharedSub as new threading.thread(addressof Startnewscan)
startsharedsub.start()
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.
thank you in advance
|
|
|
|
|
You absolutely cannot touch UI controls from a thread.
You have to Invoke methods on the UI thread to update the controls for your threaded code.
There's a lot of examples[^] of this all over the web.
|
|
|
|