|
I'm thinking you are a police agent , not a programmer !?
I'm working in a partner with this institution , and my job is to declare on website some data. until now , i declare manually , so i open my program window , i get values for example : 2,3,67,90 , after i go to website , i fill the textboxes with these values and i press the button , after i get the next record and .... this work is very hard because there are 300-700 record to transfer on website manually. I want to transfer these records automatically from my program to website .
This has nothing to do with " integrate your application with their site". This is just a way to simplify my job. I'm not making something illegal with this website. Maybe i'm not clear with that i want to do ?
Anyway , thank you !
|
|
|
|
|
alejx wrote: thinking you are a police agent , not a programmer
Nope, software developer here for 20+ years and college professor
alejx wrote: is very hard because there are 300-700 record to transfer on website manually
Understandable. A consultant I once worked with went by the idea of if you have to repeat something many times, make a computer do it
The other poster made a good point and you may want to get with the person who developed the page if possible, and see what solution you can come up with.
You need to look at the fields that each control passes in the POST and mimic it with your application.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Ok , i make my question more simple :
Is there any way to fill 2 textboxes in a webpage from a vb.net application , and after to press a button in this webpage ,all these things automatically with some instruction on my application. for example in google.com to put "sport" and after to press "Google search" button automatically with instruction from my vb.net application ?
If you help me with this , i know what can i do in my application
Thank you.
|
|
|
|
|
alejx wrote: make my question more simple
I understand your objective goal here. Best solution for you is to look into working with sending a POST as David suggested earlier. You will not need to interact with the webpage itself, but with gets invoked after the button would be clicked if there was a user.
There is no API that is going to allow your code to act as a user, i.e. entering data into text boxes, and clicking on buttons, and there's security reasons behind that.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
thank you !
But someone shows me an application in vb.net that get data from an open Excel file and transfer them into a open webpage on IEXplorer , one by one , with a button pressed at the end. And everything was ok and he transfer about 50 records from Excel.
But he doesn't want to help me , so i have maked the question.
Anyway , Thank you !
|
|
|
|
|
Perhaps through Office Interop and some Macro magic. Interesting idea...
alejx wrote: he doesn't want to help me
That's a bummer. Offer him lunch or something
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
someone else , give me 2 lines of code as example, but i'm not clear :
Dim doc As HtmlDocument = Me.webBrowser1.Document
doc.GetElementById("myId").SetAttribute("Value", "someValue")
.....
what is this ?
|
|
|
|
|
From the looks of it, webBrowser1 is a web browser control embedded in the application, and doc is the HTML document that is inside the control. With the combination of the GetElementById and the SetAttribute methods, that might be something to look into. If you know the names of the element Id's, you can also use David's suggestion as well. Either of these ways could work.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I'm sorry , this is my last question , is there any way to analyze a webpage and to find the names of the element Id's , and after to use them like in example ?
Thank you !
|
|
|
|
|
alejx wrote: find the names of the element Id's
You can simply look at the HTML source, and if you are using Firefox, there's the Inspect Element option on the pop up menu when you right click a page.
alejx wrote: my last question
Don't worry about it, asking questions is how one can learn
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
hi all experts
i'm try to Make voice chat by this example in the site
but i use vb not C# every thing is good with C# but in vb the send Voice not Work i dont know why if you want to send my sample its ok
this is part of the Code
/////////////////////////////////////////////////////
void SendVoiceBuffer(object VoiceBuffer, EventArgs e)
{
try
{
byte[] PCM_Buffer = (byte[])VoiceBuffer;
byte[] Encoded =ALawEncoder.ALawEncode(PCM_Buffer);
Send_Bytes(Encoded);
this.Dispatcher.BeginInvoke(new ShowMessagedelegate(ShowBufferSize), Encoded.Length.ToString());
}
catch (Exception ex) { ShowMessageBox(ex.Message); }
}
Public Overloads Shared Function ALawEncode(ByVal data() As Byte) As Byte()
Dim size As Integer = data.Length / 2
Dim encoded As Byte() = New Byte(size - 1) {}
For i As Integer = 0 To size - 1
Dim _part1 As Integer = data(2 * i + 1)
Dim _part2 As Integer = data(2 * i)
Dim _test As Byte = BitConverter.GetBytes((_part1 << 8) Or _part2)(0)
encoded(i) = ALawEncode(_test)
Next
Return encoded
End Function
Public Overloads Shared Function ALawEncode(ByVal pcm As Short) As Byte
Return pcmToALawMap(pcm And &HFFFF)
End Function
/////////////////////////////////////////////////////
Hint:
The Buffer filled with data in (SendVoiceBuffer) in vb is totally different with this one in C#
i appreciate every answer
thank you
|
|
|
|
|
You can re-use the C# control without having to rewrite it. Simply add the project to your VB.NET solution, and all should work.
Which begs the question; what do you think you'll gain from translating this to VB?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
nothing to gain my client want every single line to be in vb.net not C#
|
|
|
|
|
Does your client understand there's nothing to gain here? I for one, pass on the exercise - if the online converter[^] doesn't do the trick, then some other reader will hopefully do the translation for you.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi Friend,
Can anyone help me, of-course i'm a begginer in the world of VB.Net and I like to create a player that could be able to play video between a specific period of time.
|
|
|
|
|
I guess you can use the Start , Stop and Pauze functions. AFAIK, there's no .NET class to play MP3-files. There's a good starting-point here[^].
No, I am not going to provide code. The fact that you're a beginner does not mean that I'm going to introduce "all required steps". If the project sounds too complex, it probably is - and in that case you'll be helped more with a good introductory book than being frustrated by people on the forums telling you that it's crappy code.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello, i need help with this code to make the line visable as drawing and not just after. any help would be great
Public Class Form1
Private lines As New List(Of Line)
Private start As Point
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.PictureBox1.Image = New Bitmap(Me.PictureBox1.Width, Me.PictureBox1.Height)
End Sub
Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
Me.start = e.Location
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
Dim [end] As Point = e.Location
Me.lines.Add(New Line(Me.start, [end]))
Dim area As New Rectangle(Math.Min(Me.start.X, [end].X), _
Math.Min(Me.start.Y, [end].Y), _
Math.Abs(Me.start.X - [end].X), _
Math.Abs(Me.start.Y - [end].Y))
area.Inflate(1, 1)
Me.PictureBox1.Invalidate(area)
Me.PictureBox1.Update()
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Me.DrawLines(e.Graphics)
End Sub
Private Sub Save()
Using g As Graphics = Graphics.FromImage(Me.PictureBox1.Image)
Me.DrawLines(g)
End Using
Me.Clear()
End Sub
Private Sub Clear()
Me.lines.Clear()
Me.PictureBox1.Refresh()
End Sub
Private Sub DrawLines(ByVal g As Graphics)
For Each line As Line In Me.lines
g.DrawLine(Pens.Black, line.Start, line.End)
Next line
End Sub
End Class
Public Class Line
Private _start As Point
Private _end As Point
Public Property Start() As Point
Get
Return Me._start
End Get
Set(ByVal value As Point)
Me._start = value
End Set
End Property
Public Property [End]() As Point
Get
Return Me._end
End Get
Set(ByVal value As Point)
Me._end = value
End Set
End Property
Public Sub New()
Me.New(Point.Empty, Point.Empty)
End Sub
Public Sub New(ByVal start As Point, ByVal [end] As Point)
Me._start = start
Me._end = [end]
End Sub
End Class
|
|
|
|
|
Member 9397499 wrote: i need help with this code to make the line visable as drawing and not just after
After "what"? Please describe the current behavior and the desired behavior.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
The program draws a line like the line tool in paint over a picture box sets the line from point a to point b. But in paint for instance the line in visible as you are drawing it from point a to b. In this case the line is only visable after you let the mouse go at point B.
So you can't see the line until after you have it in place.
I would like to see the line being made instead of just after i click a to b.
|
|
|
|
|
See my response to your question. You need to use the correct methods to do the painting if you want it to be permanent.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
That makes more sense; there's quite some examples out there on drawing a rectangle with the mouse. Google for "marching ants" or "rubber band drawing".
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
You are drawing in the wrong part of your code. All drawing must be done in the override of the OnPaint[^] method of the control or form that you are referring to.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Am just a starter and I really need to a lot about API in visual basic 6.0, can any body help me with some notes or anything on it.
|
|
|
|
|
Ainnop wrote: visual basic 6.0
If you are just starting why are you bothering with that ancient unsupported train wreck? Get Visual Studio Express edition for free from Microsoft.
If you really insist that you need VB6 information, then google is probably your best best.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Well I have vb 8.0 but where do I start from and how do I start, may be you can help me, if you have any Ideas, thank you
|
|
|
|