|
You'd be better off asking this in the ASP.NET forum.
OK. This is going to get complicated. Take a look at this[^] article here on CodeProject. Basically, you are supplying a seperate URL for the source of the image, which will generate the new image and return it in the Response.OutputStream object. You can also find out more about the process here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Im' getting system errors and i cant figure out whats wrong with my code. Im basically trying to get a form to pop up, when the timer function hits a certain time.
basically after 10secs a form (alternative1) should automatically pop up, then 35secs later the form alternative2 should popup.
below is the code.
int numberofcalls = 0 <---error: declaration expected?
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
if numberofcalls = 0 then
form alternative1 = new form() <-- form is a type and cannot be used as an expression (same error for alternative1)
alternative1.show() <-- reference to non-shared members requires an object reference
numberofcalls = 1
timer1.interval = 25000
end if
if numberofcalls = 1 then
form alternative2 = new form
alternative2.show()
numberofcalls = 2
timer1.interval = 30000
end if
help....
|
|
|
|
|
You are mixing C# code with VB code. In VB variables are declared using the Dim statement.
---
b { font-weight: normal; }
|
|
|
|
|
Instead of:
jady84 wrote: int numberofcalls = 0
Put:
Dim numberofcalls as integer = 0
Posted by The ANZAC
|
|
|
|
|
Start VB.Net Pogramming with microsoft MCSD & MCAD books
but ur problem
1) create ur own two forms ,Firstform & Secondform
2) enable timer & set the interval property=1000 (1 Sec)
3) in the timer tick sub write:
static i as integer
i+=1
select case i
case 10
FirstForm.Show
case 35
SecondForm.Show
end select
AEK
|
|
|
|
|
Hi,
I have some perl codes that i would like to use in Visual Studio.Net.
Is it possible for me to do so? I am coding in VB.
Thanks in advance!
|
|
|
|
|
I am not really sure what you are asking, but you can convert the perl code to VB.NET or you can call System.Diagnostics.Process.Start ("perl.exe scriptname.pl").
Mike Lasseter
|
|
|
|
|
Hi Mike,
Thank you for your help
Silver
|
|
|
|
|
Hi,
I'd like to know how to display all processes currently running in a ListView control, and if the user right-clicks on a process that an options menu pops-up with the action: close, and then the process has to be closed. Any ideas, anyone? (sample code svp )
--Zaegra--
|
|
|
|
|
Using the System.Diagnostics.Process class you can get a handle on all the current processes of the user computer. You can use the GetProcesses() method to return an array of processes that can then be altered through a limited feature set.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
The Following code will be useful to you to get the process
-----------------------------------------------------------------------------
Public Function GetProcess(ByVal strquery As String, ByVal strhost As String)
Try
Dim searcher As Management.ManagementObjectSearcher
Dim connect As New Management.ConnectionOptions()
Dim objcollection As Management.ManagementObjectCollection
Dim observer As Management.ManagementOperationObserver
Dim mgmtscope As Management.ManagementScope
Dim oq As New Management.ObjectQuery()
If Not String.Compare(HostName, Environment.MachineName, True) = 0 Then
connect.Username = UserName
connect.Password = Password
End If
mgmtscope = New Management.ManagementScope("\\" & HostName & "\root\cimv2", connect)
mgmtscope.Connect()
oq.QueryString = strquery
searcher = New Management.ManagementObjectSearcher(mgmtscope, oq)
objcollection = searcher.Get()
GetProcess = objcollection
Catch exe As Exception
MsgBox("Failed to connect to the specified machine : " & exe.Message, MsgBoxStyle.Critical, "Connection failed")
End Try
End Function
-----------------------------------------------------------------------------
After this populate the values in the list view
To start or stop the process use the conntext menu, there use
system.Diagnostics.Process.Start(applicarton name.exe) to start(This can be got from selected value prpperty from thhe list view. similarly to stop
system.Diagnostics.Process.Stop(applicarton name.exe))
I think its ok its working for me
sdddf
|
|
|
|
|
hi gyes,
I ma trying to excecute an insert statement to the data base but it does not work for a reason I don't know. the following code displays what I have.Please if any bode can help:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim q As String
q = "insert into user_proj_trans(user_index,proj_code,proj_trns,user_expired_time) values(1,1,1,'30/12/2006')"
Dim com As New OracleClient.OracleCommand
Dim con As New OracleClient.OracleConnection("user id=osama;data source=dev;password=osamama")
com.Connection = con
con.Open()
Dim da As OracleClient.OracleDataAdapter
com.CommandText = q
Try
If con.State = ConnectionState.Closed Then con.Open()
com.ExecuteNonQuery()
Catch ex As Exception
ex.ToString()
End Try
MsgBox("process had been done successfully...")
con.Close()
End Sub
O.N.Barahmeh
|
|
|
|
|
what error are you getting?
|
|
|
|
|
It does not save the query into the data base
|
|
|
|
|
obarahmeh wrote: It does not save the query into the data base
That is not an error message, that is only a symptom.
You are catching the exception and ignoring it. This is a big no-no, as it gives you no means of telling what the error is, and no indication that there was an error other than that the code is "not working".
Re-throw the exception in the Catch block, or at least display the message of the exception, so that you see what the error message is.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you very much Mr.Guffa, you realy helped me to solve my problem. and the problem here was in the month entered(an invalid month), and so I could solve it.
Thank you again man
|
|
|
|
|
Did you try your query in the query analyser? Knowing the exception is the first step in solving the error. Anyways Make sure that your connection string is correct , and that any string parameter is surrounded by quotes like '<some value>'and finally that you are not violating any primary/foriegn key constraint.
|
|
|
|
|
I am using text boxes to enter names. If the text is entered in lower case letters i have put a line of code to change the first letter to upper case
txtName1.Text = Char.ToUpper(txtName1.Text.Chars(0)).ToString() + txtName1.Text.Substring(1)
like so. My problem is, suppose the name is double barreled like carly-anne
i can change the C to a capital but how do i change the second name "anne" to "Anne"
Thanks from Zeldacat
|
|
|
|
|
My guess would be to look at the previous letter and convert the current letter to Upper Case if it is a ' ' or a '-'.
Mike Lasseter
|
|
|
|
|
try:
Public Sub Replace(ByRef Text As String, ByVal Separator As String)
If Text.Contains(Separator) Then
Dim i As Integer
i = Text.IndexOf(Separator)
Text = Text.Insert(i + 1, Char.ToUpper(Text.Chars(i + 1)))
Text = Text.Remove(i + 2, 1)
End If
Text = Text.Insert(0, Char.ToUpper(Text.Chars(0)))
Text = Text.Remove(1, 1)
End Sub
AEK
|
|
|
|
|
'Or you can try this.
--------------with comments-----------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Me.TextBox1.Text <> Nothing Then 'make sure the textbox value is exist.
Dim NameParts As String() = Split(Me.TextBox1.Text) 'split the name parts into an array.
Dim FullName As String = "" 'make a buffer to save the processed name parts.
Dim nMax As Integer = NameParts.GetUpperBound(0) 'number of name parts.
For i As Integer = 0 To nMax 'iterate through the element of name part array.
'Replace first character with upper case character on each elements.
NameParts(i) = Mid(NameParts(i), 1, 1).ToUpper & Mid(NameParts(i), 2).ToLower
FullName &= NameParts(i) & " " 'save into buffer.
Next
Dim xTrim As Integer = FullName.Length - 1 'count characther length in fullname
FullName = Mid(FullName, 1, xTrim) 'remove space character at the end of fullname.
Me.TextBox1.Text = FullName 'put the processed value back into textbox
End If
End Sub
--------------without comments-----------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Me.TextBox1.Text <> Nothing Then
Dim NameParts As String() = Split(Me.TextBox1.Text)
Dim FullName As String = ""
Dim nMax As Integer = NameParts.GetUpperBound(0)
For i As Integer = 0 To nMax
NameParts(i) = Mid(NameParts(i), 1, 1).ToUpper & Mid(NameParts(i), 2).ToLower
FullName &= NameParts(i) & " "
Next
Dim xTrim As Integer = FullName.Length - 1
FullName = Mid(FullName, 1, xTrim)
Me.TextBox1.Text = FullName
End If
End Sub
|
|
|
|
|
I have a problem :
Description of problem:
When I use coding to copy a large file like 700MB to a different location. It takes upto 5 minutes. So I want to show some continues working Progress Bar.
But when it starts copy process all the activities hanged. No Progress bar visible at that time.
Please give any solution.
|
|
|
|
|
|
try
progressbarname.refresh
in loop that copies the file
|
|
|
|