Jump to content
Xtreme .Net Talk

Derek Stone

*Gurus*
  • Posts

    1910
  • Joined

  • Last visited

Everything posted by Derek Stone

  1. Dim oExcel As Excel.Application oExcel = New Excel.Application() Dim wb As Excel.Workbook = oExcel.Workbooks.Open("E:\Book1.xls") Dim ws As Excel.Worksheet ws = DirectCast(wb.Worksheets("Sheet1"), Excel.Worksheet) ws.PageSetup.Orientation = Excel.XlPageOrientation.xlLandscape ws.PrintOut() wb.Close() oExcel.Quit() oExcel = Nothing
  2. The exception has nothing to do with the timer itself. The code executing in your ComTimer_Tick event is the problem. The StartTime property of the Process class is not supported on Windows 98.
  3. HTML does not support posting back via a anchor (link). You can rig up a JavaScript function that will allow you to do it, however personally I'd consider that a poor solution. Why can't you use the query string method, as bungpeng suggested? This is how most, if not all web applications perform paging.
  4. [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemNetSocketsTcpListenerClassTopic.htm[/mshelp]
  5. You call the Close method of the TcpClient object returned by TcpListener.AcceptTcpClient.
  6. The Windows Media 9 SDK includes this functionality. Look for the SDK on MSDN.
  7. Make reference to the Web service's assembly in the application that consumes it. Then declare an instance of the service's class and access the type via it. If the Web service isn't in a compiled form rearrange it so it is.
  8. I've answered all these questions, above. Please re-read what I have stated. Sessions use more resources because the session data is stored on the server, not on the client. This translates to higher memory usage by the server, since each session will need its own dedicated "chunk of space". The only data stored on the client is the session ID, which is mapped to the chunk of space on the server when a session variable is requested.
  9. That is correct (as long as you have not set the HttpSessionState's IsCookieless property to true). The only data a session cookie stores is the session ID. That ID is mapped to a memory store on the web server (the ASP.NET worker process more specifically), SQL Server or a state server, depending on which option the developer has chosen. If this ID is not sent with an HTTP request (for example if cookies are disabled) the server will establish a new session, since the previous one was never saved to a cookie on the client.
  10. There's really nothing wrong with developing a COM DLL in .NET as long as the methods and properties it exposes accept and return basic types that are supported by Windows itself. I wouldn't try passing a DataSet for example, since it's just not going to work (that easily, it is possible). VolteFace's concerns are warranted though, so I'm hardly disagreeing with his statement, above.
  11. Dim m As Mutex = New Mutex(False, "ApplicationName") If Not m.WaitOne(0, False) Then 'Application is already running End If
  12. You need to implement IComparable in your listNameItems class. Public Class listNameItems Implements System.IComparable Public Overloads Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo 'Compare object passed to current object End Function Public listText As String Public listValue As String Public Sub New(ByVal text As String, ByVal value As String) MyBase.new() listText = text listValue = value End Sub End Class [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemIComparableClassCompareToTopic.htm[/mshelp]
  13. I hate to jump on bungpeng's statements here, but sessions, by default, use cookies. The session object in ASP uses them, and ASP.NET is no different. You can set the HttpSessionState object to embed the session ID in the URL though, as Vidhya mentioned in his first post. You can set the Timeout property of the HttpSessionState object to a higher integer value if your application needs a longer session timeout value. Leave it at its default value and the cookie (and therefore the session) will be destroyed once the browser is closed.
  14. Just in case anyone is interested... You can turn Option Strict on by default for individual project types by adding the following line to the script file under \Visual Studio .NET\Vb7\VBWizards\ProjectType\Scripts\LocalizationCode\. project.Properties("OptionStrict").Value = 1; I've found this helpful, since my "memory chromosome" is lacking...
  15. I'd feel bad for the poor chap who has to find the one pixel that represents Vatican City!
  16. If the key does not exist the RegistryKey object returned will be null (the Nothing keyword in Visual Basic .NET).
  17. The reason why this is occuring is rather obvious, however the solution might not be. The DLL is executing on the client under the .NET runtime permission set "LocalIntranet" or "Internet". This allows for file storage, but not just anywhere on the system. The classes under System.IO.IsolatedStorage allow for the creation and use of isolated file stores, which is most likely the solution you're looking for.
  18. When the protected property IsReadOnly is set to true it would be impossible to simply remove the Set method. In other words, a method's visibility can not depend on the value of a property, nor any other factor. The method will always be visible. Under most cases IsReadOnly is set to false, and the collection can be modified using Set(). However, in a unique case such as this, Microsoft deemed it necessary to disallow modifications to the collection, since that would lead to confusion as to what function those modifications would serve.
  19. The QueryString collection is read-only. You'll have to copy each element to a new NameValueCollection if you wish to modify anything.
  20. [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemThreadingMutexClassTopic.htm[/mshelp]
  21. Is the DLL properly registered? The error that you are getting indicates that it is not.
  22. I think it is rather ironic that those developers who choose to use any form of notation on variables neglect to use that same notation on member variables. -This- makes little sense to me.
  23. Can you paste the entire block of code? I'd like to see one thing...
  24. I had a feeling it was due to an external problem. Glad you found it.
  25. Why would it be trying to establish a connection if you're already online? I'm guessing you are as clueless as I am.
×
×
  • Create New...