Jump to content
Xtreme .Net Talk

Derek Stone

*Gurus*
  • Posts

    1910
  • Joined

  • Last visited

Everything posted by Derek Stone

  1. You can setup any DUN connection in Windows 2000/XP (not sure about Windows 9x/ME) to not display a window prior to, or during the dial-up process. Uncheck all of the boxes under "Dialing Options" in the properties dialog of the connection in question.
  2. http://www.elitevb.com/content/01,0077,01/01.aspx
  3. Just draw the text directly to the form in its Paint event.
  4. Try replacing the WD_USB_SCAN_DEVICES with the following declaration instead. Structure WD_USB_SCAN_DEVICES Dim searchId As WD_USB_ID Dim dwDevices As Integer MarshalAs(UnmanagedType.LPArray, SizeConst:=29)>Dim uniqueId() As Integer MarshalAs(UnmanagedType.LPArray, SizeConst:=29)>Dim deviceGeneralInfo() As WD_USB_DEVICE_GENERAL_INFO Dim dwStatus As Integer End Structure As it stands now the SizeOf method is getting passed arrays of unfixed sizes, meaning it can't calculate the entire size of the structure.
  5. System.Drawing.Printing.PrinterSettings.InstalledPrinters
  6. It all depends on what the "Scan" object is. The Marshal class under System.Runtime.InteropServices should provide you with a method to do just what you need. Also, you should be using the Marshal.SizeOf method instead of VB.NET's LenB function.
  7. Look into the [mshelp=ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemCodeDomCompiler.htm]System.CodeDom.Compiler[/mshelp] namespace. It provides runtime compilation services, eliminating the need for other scripting languages. With it, you can compile any .NET program into an executable or a library. Also, look for a CodeDom example by divil in the Code Library.
  8. Variables are only in scope in their containing block. In other words, the variable strSQL exists only between the opening If and closing End If. When you try to reference it outside of that block the compiler will throw an error at you, since it no longer exists.
  9. I don't understand why you'd want to do things like this, but I don't really need to know, do I? :) Forget about the code-behind and add the following to the ASP.NET page itself: <html> <head> <title>Demo</title> </head> <body onload="window.close()"> </body> </html>
  10. Have the code-behind output the appropriate JavaScript, window.close(), to the page. The location to output the JavaScript all depends on what you're trying to accomplish.
  11. 1. If Object = Nothing Then 'Object is null 2. DataSets don't have rows. DataTables do. Either way, the current row you're looking is the current row you're looking at. If you're trying to determine the row number add a counter to your row enumeration. 3. If the value is constant store it in the application's web.config file. If it is variable, use a shared method of a class, imported to each page, to add, change and delete values to a database, session object or cookie.
  12. PrintViewForm P; if(Old) { if(P = null) { P = new PrintViewForm(); } // Your code here }
  13. We're going to need more specific details. What exactly are you trying to do? A code snippet would help significantly.
  14. Pass a reference of the class (the form/window) instead of creating a new instance.
  15. The whole point is the server didn't process it. The ASP.NET ISAPI DLL wasn't installed, meaning IIS didn't have any verbs to parse for the .aspx extension.
  16. TextBox MyTextBox = new TextBox(); void page_load(Object sender, EventArgs e) { MyTextBox.Text = "foobar"; MyPlaceHolder.Controls.Add(MyTextBox); } That should work fine, even if you decide to modify properties after the control is added to its placeholder.
  17. Don't allow the user to input a string date. Use ComboBoxes or a DatePicker instead. These methods make avoiding the problem rather simple.
  18. Dim alMain As ArrayList = New ArrayList Dim iMain() As Integer = {1, 2, 3, 4, 5} alMain.Add(iMain) If you needed ArrayList-like functionability for the 2nd-dimension change the array into an ArrayList and add that instead. I would not recommend this method for large lists or processor intensive code blocks, nor is this a viable solution for all cases.
  19. Once you declare a WebControl as shown below, you can access it throughout the current page using its ID property. <asp:TextBox id="MainTextBox" runat="server" /> Sub Page_Load(sender As Object, e As EventArgs) MainTextBox.Text = "foobar" End Sub
  20. No, I wouldn't recommend placing values that aren't constant in web.config. Of course the values can be changed, rather easily, since a web.config file is XML. However, using a shared method of a class that saves the data to a database, session object or cookie would be a much more appropriate method.
  21. [mshelp=ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconexposingpageletproperties.htm]This help document[/mshelp] explains the process of implementing programmer defined properties in a UserControl. It might not be exactly what you want, but that's how it's done for the most part.
  22. He gave you the client source. IIS wasn't parsing the .aspx extension, meaning the output sent to the client is the exact same as the contents of the .aspx file.
  23. There's no need for a module. You can store the values in a shared class which is imported to each page, or in the application's web.config file. Both methods have their advantages.
  24. I've never actually handled UserControls like that, so I'll look into it and get back to you. For now try adding the following line to the codebehind: Protected WithEvents [i]ControlID[/i] As System.Web.UI.UserControl I imagine that'll work unless you're attempting to access programmer defined properties.
  25. Session cookies destroy themselves when the browser is closed. There is no need to detect the browser's termination. Simply requery the cookie on each request to ensure that the user is in fact authenticated.
×
×
  • Create New...