Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. The output from any .Net compiler will generate similar, but not exactly the same MSIL, for a given construct. Some things seem to be slightly more optimised in C# than VB but other things are vice versa.... The JIT compiler will generate its machine specific code from this MSIL so again there will be slight differences. Not sure how much this will add up to performance wise though. If you are using VB simply avoiding the VB language elements that have .Net equivalents and always ensuring Option Explicit is on and Option Strict is on will force you to write code with correct type conversion etc. This can result in more optimal MSIL being generated. Also remember that as .Net matures the language compilers will get more tuned as will the JIT engine itself.
  2. Does the ASPNET account on the server have permissions to this folder?
  3. I think bungpeng was refering to software design, not UI design. I tend to agree with him on this one - getting the software correctly designed and planned is a lot more important than choice of language, especially under .Net where most languages are very similar in what they can do. Vb.Net isn't really that much easier than C#, the core principles are the same, the basic language structures and runtime support are the same. This is one of the ideas behind .Net - allow people to choose the language that suits them rather than force them into a particular language. People can focus on solving problems rather than struggling with a language they don't like.
  4. Does the web server have office installed? If not it will need it if you are doing this through the Office components.
  5. You set this as part of the PC's display properties (under appearance,advanced on XP)
  6. the .SmtpServer should be the address of a valid smtp server - you appear to be setting it to a web-site. Hotmail is a web based mail service and I don't think you can access as if it was a smtp based mail server.
  7. C# does have a few features that are missing from VB - operator overloading, conversion function overloading, a more efficient event dispatch syntax, support for the using statement with IDispatch are a few that spring to mind.
  8. Do the other computers have the relevant dlls present and registered?
  9. So TextBox1 contains text to be appended to the file? If so which textbox contains the file name to be opened?
  10. right click on the watch window and un-tick the option for hexadecimal display.
  11. Try adding the item after you've databound the list - otherwise it will reset the list as part of the databinding.
  12. Add a new project to the solution, look under 'Setup and Deployment'
  13. Are you databinding in the page_load event? If so you need to check Page.IsPostback and only databind when it is false. If that doesn't fix the problem could you post the relevant parts of your code?
  14. I notice you are declaring your streamreader but not actually opening in, you will need to set SR = new System.IO.StreamReader(). Also do you want to stop looping when the text equals the contents of textbox3 or when the file has no more data? Also when you issue the SR.ReadLine command you are not assigning the result to anything. Have a look at the following and see if it helps Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim line As String = TextBox3.Text Dim SB As System.Text.StringBuilder = New System.Text.StringBuilder() Dim SR As System.IO.StreamReader SR = New System.IO.StreamReader(TextBox1.Text) Do line = SR.ReadLine() If line <> (TextBox3.Text) Then SB.Append(line) SB.Append(System.Environment.NewLine) End If Loop Until line Is Nothing SR.Close() Dim SW As New IO.StreamWriter(TextBox2.Text, True) SW.Write((SB.ToString())) SW.Close() End Sub
  15. System.Diagnostics.EventLogEntryType
  16. try Dim t As Thread Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim th As New ThreadStart(AddressOf test) t=new thread(th) t.Start() Me.timedelay(1000) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click t.Abort() End Sub not tested at all ;) Not even proof read :D but moving the declaration of the thread into a form level variable means you can access it from anywhere in the form.
  17. Dim progs() As Process progs = System.Diagnostics.Process.GetProcesses Dim p As Process For Each p In progs Dim title As String = p.MainWindowTitle If title <> String.Empty Then ListBox1.Items.Add(title) End If Next then
  18. Dim progs() As Process progs = System.Diagnostics.Process.GetProcesses Dim p As Process For Each p In progs ListBox1.Items.Add(p.ProcessName) Next
  19. char can be quicker on heavily updated tales though - SQL will always have the correct ammount of space allocated. Using varchar it is possible that if you update a field to a longer string then it will have to turn the update into a delete/insert behind the scenes. Although not a major issue this can result in unwanted page splits in indexes etc.
  20. Just a quick answer for now - you may want to investigate authentication within the .Net frame work. This will allow you to check if a user is in a particular role (group). The two main forms are Windows Authentication (useful if you have a windows domain) or Forms Authentication (if you need to create your own security model). If you have a search on MSDN or http://www.gotdotnet.com you should find a fair few examples. As to enabling or disabling these you may want to look at some of the events of the datalist - not sure which would be the most useful as my MSDN is playing up (doing a new install of VS at the moment).
  21. Yes but the command MessageBox.Show will block until the user clicks ok, therefore the sendkeys command won't execute until after tthe messagebox has been clicked on.
  22. You are opening your streamreader (SR) but then closing it after only 1 Readline. you would really need to do this in a loop. Try something like the following (not tested though so no promises) Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim line As String = "" Dim SR As New IO.StreamReader(TextBox2.Text) Dim SB As System.Text.StringBuilder = New System.Text.StringBuilder Do line = SR.ReadLine If line <> TextBox4.Text Then SB.Append(line) SB.Append(System.Environment.NewLine) End If Loop Until line = "" SR.Close() Dim SW As New IO.StreamWriter(TextBox2.Text, False) SW.Write(SB.ToString()) SW.Close() End Sub
  23. One you are using the old VB6 msgbox rather than the .Net MessageBox.show and 2 it wouldn't execute the SendKeys until the messagebox has been closed manually anyway.
  24. You should be able to return a dataset from a webmethod - I've done it myself several times. If it isn't working could you post your code or more details on how it is failing?
  25. Have you created the command object before you reference it? Dim connString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=localhost;" & "DATABASE=ivertecproject;" & _ "UID=root;" & "PASSWORD=;" & _ "OPTION=3" MyConnection = New OdbcConnection(connString) MyConnection.Open() MyCommand = new OdbcCommand() 'I think. MyCommand.Connection = MyConnection
×
×
  • Create New...