|
Sir can you send me source
|
|
|
|
|
hi, im new here and i have a question. i wanna to make a fb chat.
I can make to send from textbox to fb message, but i can't make it to read from fb message to textbox.
Please can help me someone.
this is my code: http://www.mediafire.com/download/08k0hhrha78sy6q/FBCP.rar
|
|
|
|
|
Your code is a download, and not in readable text. I cannot even download from mediafire as it is blocked here.
It seems that XMPP[^] is deprecated. What API are you using to send a message? If you don't know, can you list the references in your project or show an example of the code you use to send a message?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
with no API, i tryed somethink like this:
Form Load:
WebBrowser1.Navigate("https://www.facebook.com/messages/")
TextBox3: Press_key:
If e.KeyChar = Chr(Keys.Enter) Then
WebBrowser1.Document.GetElementById("message_body").SetAttribute("value", TextBox3.Text)
WebBrowser1.Select()
SendKeys.Send("{enter}")
TextBox3.Text = Nothing
End If
Timer1_Tick:
If TextBox3.Text = Nothing Then
TextBox3.Select()
End If
i inspect element with FireBug and i sea message are in:< p> Exeamle Message < /p>
I decode all WebBrower1.Document in a TextBox.text
But Message are not decode in textbox
but ideea was like this:
Then in timer to read all lines: <p.>Exeamle Message
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
For Each webpage As HtmlElement In allelements
ListBox1.Items.Add(webpage.GetAttribute("< p >"))
Next
Hope u understand me
|
|
|
|
|
Are you sure the document is already updated when the timer fires? Does the amount of characters in the document change, after a message is received?
Doesn't seem like a scenario that FB supports; there's multiple mentions of chat, but not by manipulating the existing webpage.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hello !
I have this code :
Public Class myclass
....
Private cont As MyentEntities
.....
.....
Public Sub New( ByRef cnx As MyentEntities)
.....
cont = cnx
.....
End Sub
Public Sub test
.....
If cont.mytable1.Count=1 then
.....
end if
End Sub
End class
And on my main form :
.......
Dim E1 as MyEntEntities
Dim m1 as myclass
Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs)
Handles Me.Load
E1=New MyentEntities
m1=new MyClass(E1)
........
End Sub
Private sub fill_entity
E1.MyTable1.Tolist
....
End sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)
Handles Button1.Click
m1.test
End Sub
When I click the button , I get an error :
....the entity of type 'MyTable1' does not exist in the context.
But this entity type is added to E1.
What's wrong ?
Thank you !
|
|
|
|
|
|
Hello !
I'm using vb.net 2013.
I have a situation when I need to pass as parameter some controls like Buttons. checkboxes and also a Bindingsource and an Entity.
Both Byref and Byval are working in my case.
but I'm asking :
- Which of them is faster and consume less memory ?
Thank you !
|
|
|
|
|
That doesn't matter; if byval works, use it.
|
|
|
|
|
PIEBALDconsult wrote: That doesn't matter Performance does not matter?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Performance is not a reason to choose between those options.
|
|
|
|
|
Hello !
But I'm telling you that both works for me.
Now I want to choose considering performance.
Thank you !
|
|
|
|
|
Not recommended. Use ByVal regardless, because it's correct.
|
|
|
|
|
Hello !
But I'm speaking about passing as argument a button , a checkbox , a BindingSource and a entity.
What about memory consuming , because Byref is passing only a pointer ? ( Or I'm wrong ?)
Thank you !
|
|
|
|
|
dilkonika wrote: Byref is passing only a pointer
It passes the reference by value.
|
|
|
|
|
Ok , let's get only a case :
Passing a bindingsource as Value or as reference , both are consuming the same memory or ?????
thank you !
|
|
|
|
|
In your example, both are passing a pointer to the BindingSource. In the case of a ByRef, your passing the pointer to the object. By passing a reference type ByVal, you're passing a copy of the pointer. Both will allow you to call methods and make changes to properties in the original object. But, ByRef will allow you to replace the original object with a new one. Passing a reference type ByVal will not.
For value types, if you pass them ByVal you are passing a copy of the value. Changing the variable in the called method does nothing to the original passed in value.
If you pass in a value type ByRef, you're passing in a pointer to the value. Any change to the variable containing the value will change the original value in the calling code.
Where you run into a performance hit, albeit as very small one, is when you pass a large structure by value. Each value type in the structure, when passed ByVal, is copied and passed to the target method. For those types, it's probably better to pass a structure ByRef.
Read this[^].
|
|
|
|
|
PIEBALDconsult wrote: Performance is not a reason to choose between those options. Sure it is. What if you are passing huge objects?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Doesn't matter. Use the right tool. If ByVal works, use it.
|
|
|
|
|
Ok , but at least , can someone give me a response for this question :
Passing a bindingsource as Value or as reference , both are consuming the same memory or ?????
Thank you !
|
|
|
|
|
If your bindingsource is a class (and it probably is) then you're passing a reference byval or byref, so it works out to the same thing.
|
|
|
|
|
I'm not sure what Pieb's going on about, but byref obviously just passes a reference, not a copy of the object. Therefore, if the object is big, byref will be faster.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Pieb is right in that one should use Byval most of the time and only use Byref sparingly, if at all.
I personally do not feel that performance is that much of an issue between the two.
And yes, Byref is passing a reference pointer back to the original variable. Whereas Byval is just passing the value to the called function/routine.
I recommend to use Byref sparingly because if, in the called subroutine, you change the value of the passed variable, what you are actually doing is changing the value in the original variable that you made your call with. See example:
Public sub TryThis
dim X as String
dim Y as String
dim Z as String
X = "Red"
Y = "Green"
Z = "Yellow"
Z = TestFunction(x,y)
debug.print x
debug.print y
debug.print z
end sub
======
Public Function TestFunction(byval Value1 as string, Byref Value2 as string) as string
Value1 = "White"
Value2 = "Blue"
Return Value1
End Function
Results: X = "Red"
Y = "Blue"
Z = "White"
Notice that the value of Y changed even though it was not referenced or accessible by name in the function. This is because Y was represented in the function as Value2 and was passed Byref. The value of X was passed ByVal and did not change even though Value1 was also changed in the function. One should be careful using Byref for this reason. ByVal should be the preferred option in most all cases.
Any time I code a Byref, I always make it clearly known in a comment at every call what is being passed byref and if any value is being returned using the byref variable.
|
|
|
|
|
dbitsch wrote: Pieb is right in that one should use Byval most of the time and only use Byref sparingly, I rarely use ByRef but never heard anyone say it should almost never be used.
dbitsch wrote: because if, in the called subroutine, you change the value of the passed variable, what you are actually doing is changing the value in the original variable that you made your call with. Yes, that IS the definition of ByRef and the reason you would use it.
I had a case years ago where I was passing an object byval, which is the default, to a function that was called repeatedly thousands of times. It turns out ByRef worked much better.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|