|
I assumed there was some built in functionality in the framework that would handle all the nuances. Similar to the way there its the built in functions to allow you to get a stream to an embedded resources, I figured there was one to allow you to write to a stream that would save it to the embebbed resource.
|
|
|
|
|
Not that I'm aware of, but the MSDN documentation will confirm that.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
DisIsHoody wrote: My only requirements is no SQL server or local file
That implies a non-local (aka 'remote') file. Shouldn't be a problem if you have a webserver there, simply access it over SSL.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello !
I have an application in vb.net 2010 /sql server 2008r2
i read data from sql server to a bindingsource ( salaryBindingSource). And now i have to get records one by one from bindingsource to a webpage ( this is not my webpage , but is my job to transfer data to this webpage).I'm thinking to make this process automatic from my aplication , because there are so many records and is difficult to enter manually .
the web page has 5 textbox , 1 combobox and 1 Button.
How can i fill textboxes and combobox with current record , press automatically the button , and continue with next records .....
i need an example how can i do this ?
Thank you
|
|
|
|
|
I think what you want to do is programatically "POST" data to that web-page.
I can't remember exatly how to do it, but search "create a post request programmatically" and I think you will find a solution.
Good luck.
|
|
|
|
|
|
Thank You !
But in this example , i don't understand how to identify the textbox names in webpage , and how can i put a specific data on a textbox , and after to press the button automatically ....
|
|
|
|
|
Are you binding the text boxes, and combo box with salaryBindingSource ? If you are, then the button should just navigate to the next record and the data bindings take care of filling in the controls. If you could supply a code snippet of what you have done, that could be helpful
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Thank You !
textboxes and comboboxes are on webpage not on my application.
on my application i have this code :
For each t in salaryBindingsource
i want to put t.value1 on first textbox of webpage
i want to put t.sum on second textbox of webpage
....
....
i want to press the button on webpage
Next
so , how can i do the instructions inside for cycle ?
Thank you.
|
|
|
|
|
alejx wrote: webpage not on my application
I may have misunderstood your problem. Is the webpage not something you created but you are trying to get your application to update the fields on the webpage?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
This is not my webpage , this is the webpage of a financial institution , and my job is to get data from my application , and to put manually on this website.But there are so many records , and i'm thinking to modify my application to put data automatically ?
how can i do this ?
Thank you !
|
|
|
|
|
Are you employed by this financial institution? And do they want to integrate your application and data with their site?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
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#
|
|
|
|