Jump to content
Xtreme .Net Talk

dynamic_sysop

Leaders
  • Posts

    1044
  • Joined

  • Last visited

Everything posted by dynamic_sysop

  1. you need to use " Navigate " , the locationurl is where the browser is currently sitting ( the webpage it's gone to ) Browser.Navigate "C:\your local.htm" '/// or Browser.Navigate "http://somesite.com"
  2. assuming you have a reference to System.Web ( or it wouldnt allow you to get as far as you have ) this should work. are you specifying the correct mail server? eg: mail.hotmail.com here's a quick sample i built up that works for me: Dim eMail As New Mail.MailMessage() With eMail .To = "csharp_@hotmail.com" .From = "dynamic" .Subject = "mail test" .Body = "some text" .BodyFormat = Mail.MailFormat.Text Mail.SmtpMail.SmtpServer = "mail.hotmail.com" '/// mail server Mail.SmtpMail.Send(eMail) End With
  3. you can do this also , much simpler.... Dim x As Integer = Integer.Parse(&H20&) MessageBox.Show(x)
  4. just proving a point that it can be done with switch ( he posted the same question on codeproject's forum and was basiclly under the impression that it wasn't possible with switch ) ;) i like to prove the impossible wrong , regardless how cheesey it may be:p
  5. you could always use the switch statement , here's a simple example :) private void val() { int x =-1; switch(x.CompareTo(0)<0) { case true: MessageBox.Show("the value is less than zero!"); break; case false: MessageBox.Show("the value is greater than zero!"); break; } }
  6. oops i forgot , you want to click it also , here ya go ... Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer) Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim x As Integer = CInt(&H2) Or CInt(&H4) Cursor.Position = New Point(300, 90) '/// put the location you want to move the mouse to , in the Point co-ordinates. mouse_event(x, Cursor.Position.X, Cursor.Position.Y, 0, 0) End Sub
  7. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Cursor.Position = New Point(300, 90) '/// put the location you want to move the mouse to , in the Point co-ordinates. End Sub or .... move yer right arm, grab the mouse and slide it along the mat ;) ( jk ):cool:
  8. i have xp pro yeah , if you want something testing i'll gladly look ( but i'm gonna watch robbie williams's gig on tele now , cuz my sister's there somewhere :cool: )
  9. are you running Xp Pro or Home Edition? i presume you have IIS running ( but not if you have Home Edition , because it wont accept IIS Server )
  10. to be able to use IIS with XP , you must be running XP Professional. Then go to Add / Remove programmes ... Add / Remove Windows Components , then choose IIS. IIS wont work on XP Home edition.
  11. you need to make a sort of chain , in form1 you make a new form2 , then add it as owned by form1 Dim frm2 As New Form2() '/// make it new. AddOwnedForm(frm2) '/// make Form2 owned by Form1 then when you have form2 open , you make a new Form3 , making that owned by Form2 Dim frm3 As New Form3()'/// make a new Form3 , from inside Form2. AddOwnedForm(frm3)'/// add it as owned by Form2 make a Function inside Form2 , which will pass data to Form1 ( this will be triggered via Form3 Public Function DoStuff(ByVal strString As String) frm1.TextBox1.AppendText(strString) End Function in your 3rd Form Dim f2 As form2 f2 = Owner f2.DoStuff("some stuff") the attached source will make it easier.
  12. here's a quick example i put you together : In Form1 : Dim frm2 As New Form2() Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.AddOwnedForm(frm2) '/// make Form2 owned by Me End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click frm2.Show() End Sub In Form2 : Dim frm1 As Form1 Dim frm3 As New Form3() Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click frm1 = Owner AddOwnedForm(frm3) frm3.Show() End Sub Public Function DoStuff(ByVal strString As String) frm1.TextBox1.AppendText(strString) End Function In Form3: Dim f2 As form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click f2 = Owner f2.DoStuff("some stuff") End Sub here's a sample source i included to make it easier to understand ... passing stuff between forms.zip
  13. why not specify a limit if it's causing a problem? here's a little example i made for you , not sure if it helps but it may : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim od As New OpenFileDialog() With od .Multiselect = True .Filter = "Text(*.txt)|*.txt" .InitialDirectory = "C:\" If .ShowDialog = DialogResult.OK Then If .FileNames.Length > 10 Then '/// max limit goes here. MessageBox.Show("To many files chosen!") Else .OpenFile() End If End If End With End Sub
  14. you could close it like this : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myProcess As Process myProcess.GetProcesses(Environment.MachineName) For Each myProcess In myProcess.GetProcesses If myProcess.ProcessName = "EXCEL" Then myProcess.CloseMainWindow() End If Next End Sub
  15. you could always do the following , to find your text in a string / textbox : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strString As String = "some StuFf In DifFeRenT CaSeS !" If Not strString.ToLower.IndexOf("stuff") = -1 Then MessageBox.Show("the word stuff was found in the string at position: " & strString.ToLower.IndexOf("stuff")) End If End Sub you can do the same with TextBox or RichTextBox , eg: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "some StuFf In DifFeRenT CaSeS !" If Not TextBox1.Text.ToLower.IndexOf("stuff") = -1 Then '/// make sure it's there or not. MessageBox.Show("the word stuff was found in the string at position: " & TextBox1.Text.ToLower.IndexOf("stuff")) End If End Sub
  16. to check if it's all numbers or not without getting the individual chars : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Not IsNumeric(TextBox1.Text) Then MessageBox.Show("it contains characters other than numeric!") End If End Sub or a better way , checking each char : Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ch As Char, chResult As Char, x As Integer For Each ch In TextBox1.Text If Not ch.IsNumber(ch) Then x += 1 chResult += ch & "," End If Next MessageBox.Show("There were: " & x & " None-Numerics in the textbox, they were: " & chResult) End Sub hope it helps :)
  17. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MessageBox.Show(Environment.OSVersion.ToString) End Sub :)
  18. further to that , if you want to check for processes that are running , here's a quick example i knocked together for you :) Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim p As Process Dim i As Integer = p.GetProcesses(Environment.MachineName).GetLowerBound(0) Dim j As Integer = p.GetProcesses(Environment.MachineName).GetUpperBound(0) Dim x As Integer For x = i To j ListBox1.Items.Add(p.GetProcesses(Environment.MachineName).GetValue(x).ProcessName & " " & p.GetProcesses(Environment.MachineName).GetValue(x).MainWindowHandle.toint32) Next End Sub you can also specify things like p.GetProcesses(Environment.MachineName).GetValue(x).ID '/// id being the ProcessID
  19. you really need to try to move away from " Shell " in .net apps :) the way is System.Process , eg: Process.Start("notepad.exe")
  20. ik probeer om een weinig Nederlands te spreken nog, kom ik oorspronkelijk uit een stad genoemd Almelo in Nederland, maar in Engeland 27 jaar geleefd. you'll have to excuse my dutch , but i've lived in the UK for 27 years so i only pick it back up again when i visit my family over there and it's been over 3 years since my last visit :(
  21. is that a typo? ^^^ or does it actually say this : IntialiazeComponent() '/// char next to last was a c but should be an n.
  22. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim user As Security.Principal.WindowsIdentity = Security.Principal.WindowsIdentity.GetCurrent MessageBox.Show(user.Name & " " & user.AuthenticationType) End Sub
  23. you could try the DataGrid control , that should add the contents of your excel file pretty much in it's correct layout . just make a reference to the microsoft excel object library , then make the DataGrid.DataSource hold the worksheet.
  24. here's a very basic example i chucked together for you :) Private Const WM_USER As Long = &H400 Private Const CCM_FIRST As Integer = CInt(&H2000) Private Const CCM_SETBKCOLOR As Integer = (CCM_FIRST + 1) Private Const PBM_SETBARCOLOR As Long = (WM_USER + 9) Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim c As ColorTranslator Dim x As Integer SendMessage(ProgressBar1.Handle.ToInt32, CCM_SETBKCOLOR, 0, c.ToWin32(Color.Red)) SendMessage(ProgressBar1.Handle.ToInt32, PBM_SETBARCOLOR, 0, c.ToWin32(Color.Blue)) With ProgressBar1 .Minimum = 1 .Maximum = 100 .Step = 1 For x = .Minimum To .Maximum .PerformStep() Threading.Thread.Sleep(10) Application.DoEvents() Next End With
  25. you will find Spy++ under the list ( Start \ All Programmes \ vs... \ vs tools... )
×
×
  • Create New...