|
If you're using VB 2003 they don't exist but there is an MS add-in that provides them.
Kevin
|
|
|
|
|
I have an application that is supposed to post data to a servlet (possibly written in java?) by using HTTP:POST
The servlet wants a form filled in which has two text fields and a file upload field e.g.
<form id="ServletTest" method="post">
<input id="Username" name="Username" type="text" />
<input id="Password" maxlength="100" name="Password" type="text" />
<input id="theFile" name="theFile" type="file" />
<input id="SubmitButton" type="submit" value="submit" />
</form>
Unfortunately the servlet is not yet developed, so I need to emulate this behaviour to test my code.
When it is created I will be using something like:-
Dim webReq As WebRequest = WebRequest.Create(My.Settings.ServletURL)
With webReq
.Method = "POST" 'set the request method to POST
.ContentType = "multipart/form-data"
End With
Dim newStream As Stream
Try
newStream = webReq.GetRequestStream()
Catch exPV As ProtocolViolationException
My.Application.Log.WriteException(exPV)
Return False
Exit Function
Catch exW As WebException
'Pass this exception on to the caller to decide what to do with it,
'as it may indicate a temporary problem
Throw
Catch ex As Exception
My.Application.Log.WriteException(ex)
Return False
Exit Function
End Try
How would I create an application that my code can run against to post this form to?
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hi,everybody
A difficulty happens to me when i programming.I heartly need your help.
My program is:
i read datas from a test equipment once per 100ms.At the same time,i draw this data to coordinate.As follow:
Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
tg = Me.Panel1.CreateGraphics
' tg.TranslateTransform(xtran, ytran)
'tg.ScaleTransform(xscaletran, yscaletran)
xaxis2 += 5.0 ' x coordinate add 5 pixles once
yaxis2 = Tesle() * 10 ' tesle() is a function reading data from
'test equipment
rwrecord += 1
tg.DrawLine(dpen, xaxis, -yaxis, xaxis2, -yaxis2)
xaxis = xaxis2
yaxis = yaxis2
xredraw(rwrecord) = xaxis
yredraw(rwrecord) = yaxis
tg.Dispose()
End Sub
Private Sub Tesle()
Dim inbuffer As String
Do
inbuffer = AxMSComm1.Input
Loop Until InStr(inbuffer, vbCr)
Dim readdata As String
Dim istart As Integer
Dim mstart As Integer
Try
istart = inbuffer.IndexOf("-")
mstart = inbuffer.IndexOf("+")
If istart < 0 Then
Tesle = inbuffer.Substring(mstart, 8)
Else
Tesle = inbuffer.Substring(istart, 8)
End If
Catch ex As Exception
End Try
End Sub
Above is the main code.If i do nothing(such as moving the form),it will draw chart exactly.But when i moved the form(any action activate paint event),It will not draw the point at that time point.after paint event over,it will draw chart well.
i have do something to debug the problem.i find that when form paint event activated.the data read from test equiment is null.here the problem is.
And now i want to get your help.How can i sove the problem.
Waitting for your reply.
Any reply will be appreciated
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
The solution is surprisingly simple. Don't draw on the Panel surface. Draw to a Bitmap object that same size as the panel. Set the BackgroundImage property of the panel to the Bitmap. now, when you draw on the Bitmap, just call Refresh on the Panel.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you for your reply.
Do you think the issue is on the "drawing"????
I think it is on the reading data from test equipment.
when i moving(or other actions) form.at the time i am releasing left mouse,the data readed from test equipment is null.
So i think the issue is between timer_elapsed event and communicating between pc and test equipment.
when i am doing form events,the communication will not happen.but the timer is going on. So the fucntion tesle() returns value 0.Here the problem is.
and also,i have a test.i set the timer.interval to 300 or more.the problem will not happen.
And now if it as i am saying.How can i resolve it.
Best gardness!
ICQ:258-235-734
MSN:msnadair@hotmail.com
-- modified at 21:07 Thursday 29th June, 2006
|
|
|
|
|
First, you're doing some drawing in a Timer event. Don't! Any drawing you do to the screen should be done only in the Paint event.
Second, you're using a Timer out of the ToolBox?? This passes its Timer Tick as an event, which is routed through the app's message pump. This means that other events can pile up VERY rapidly before the Timer Tick event, such as moving the form. Using an event based Timer isn't really a good idea.
Also, 100ms doesn't leave your code very much time to do anything. Painting can take an eternity (>100ms) if not done correctly.
While you're collecting data, draw to a Bitmap. Then you don't have to worry about painting, and repainting, old data continously. You paint your data once on the Bitmap and it'll be persisted between Paint events.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you for your reply heartly!
Well.i will try to do some changes as follow:
1> take the drawing action out of timer event
2> I havn't drawn graphics to bitmap before.but i will try.
By the way.what does this sentence mean?
Dave Kreskowiak wrote: you're using a Timer out of the ToolBox??
I am using the timer control from toolbox.it is a system.timer but windows.forms.timer.
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
codeadair wrote: I am using the timer control from toolbox.it is a system.timer but windows.forms.timer.
This is the Timer I was asking about. It's not the most accurate and it's event can be bogged down by other events the form has to process.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I agree with you.
And now i am using doublebuffer method.It is really very useful .
But it is going on.and now i have to work off.
I believe i could do well to resolve the problem with your help.
Thank you very much for you help.Please follow the problem.
By the way.what's your time now?
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
codeadair wrote: By the way.what's your time now?
To you, it's comming up on Saturday. I'm still on Friday morning.
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 9:51 Friday 30th June, 2006
|
|
|
|
|
Dave Kreskowiak wrote: Draw to a Bitmap object that same size as the panel. Set the BackgroundImage property of the panel to the Bitmap. now, when you draw on the Bitmap, just call Refresh on the Panel.
Yes.I just do as you day.
But i find a problem.when i use g.ScaleTransform(xscaletran, yscaletran) method.And then refresh the panel:me.panel1.refresh.
it will take no effect.why?Have i need to redraw all datas?
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
Where did the Graphics object (g) come from??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: Where did the Graphics object (g) come from??
Graphics object (g) is a form variant.look here:
dim bmp as bitmap=new bitmap(800,600)
dim g as graphics=graphics.fromimage(bmp)
Maybe you could read my another forum question named "graphics.scaletransform() method".it describes the question clearly.
Thank you for you reply heartly!
ICQ:258-235-734
MSN:msnadair@hotmail.com
-- modified at 23:47 Monday 3rd July, 2006
|
|
|
|
|
ScaleTransform doesn't do anything until you draw something. It sets up a transform for any drawing done to the surface after the call the ScaleTransform.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: ScaleTransform doesn't do anything until you draw something. It sets up a transform for any drawing done to the surface after the call the ScaleTransform.
Yes.I think so.
And i have to redraw bitmap if i want to transform the graphic.So bitmap doesn't look very useful this time.
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
Hi
We have developed a .NET application and created a package with Visual Studio setup project(MSI file). When we try to install in a fresh XP machine then we are getting the following Error Signature,
Error Signature
EventType : clr20r3 P1 : application1.exe P2:1.0.2365.35072 P3:449bf3a9 P4:system.data P5:2.0.0.0
P6:4333aea2 P7:25c3 P8:29 P9:system.data.sqlclient.sql
The same is working in a machine where we have installed lot of other softwares.
Please share with us if you have any solution. Thanks in advance.
Regards
Arunag
|
|
|
|
|
Is .NET Framework 2.0 installed in this machine???
|
|
|
|
|
|
I think the error is in the SQLServer, try no execute the program in other machin without create a installer.
If it dosn't run, i dosn't the answer, sorry.
|
|
|
|
|
Arunag wrote: Visual Studio setup project
What is the version of your visual studio .net?
|
|
|
|
|
|
How do you create an installer for your application? I mean what is the resource that you follow to create an installer for your application.
|
|
|
|
|
It's screaming about a problem in the SqlClient. Make sure that the machine your running this on has the latest MDAC installed and you should be OK. MDAC Downloads[^]
Now, that's assuming that your code is written properly...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
the error which i face is as following
Run-time error'20536'
unable to connect: incorrect log on parameters
we are using vb6 as front end and oracle9i as back end
and created reports in crystal reports
if any one can help us then please do
thanks
akhil patel
|
|
|
|
|