Jump to content
Xtreme .Net Talk

Derek Stone

*Gurus*
  • Posts

    1910
  • Joined

  • Last visited

Everything posted by Derek Stone

  1. Notepad, if launched from an ASP.NET page will run under IIS' local user account, meaning that you won't see any windows or be able to communicate to the process from the account you're currently logged into. Windows will be displayed on the desktop associated with that account, not your desktop. The only indication you'll see is the process details in Task Manager, since all processes on the local system are displayed there, regardless of the user account they're running under.
  2. All depends. Does your usercontrol (.ascx file) inherit from a custom base class, or are the properties declared within the .ascx file itself? Also, how is the usercontrol being loaded, via LoadControl or with a Register directive?
  3. There are roughly a dozen ways in .NET to determine if a String object has no length. The more common ones include the Length property and the String.Empty field. Whichever one you choose, use it consistantly.
  4. Dim dt As DateTime = DateTime.Now Dim dtString As String = dt.ToString("yyyyMMdd") [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDateTimeClassToStringTopic3.htm[/mshelp]
  5. My apologies for not getting back to you about this issue earlier. The code blocks are still largely flawed. That doesn't surprise me much, since we are using vBulletin. ;) They should read similar to the following: <blockquote> <font face="verdana,arial,helvetica" size="1" >code:</font> <hr style="width: 100%;" /> <pre><!-- User input here --></pre> <hr style="width: 100%;" /> </blockquote> That displays correctly on IE, Mozilla (all Gecko based browsers for that matter) and Opera. As it stands now the bbcode is displaying the horizontal rules and "code:" as preformatted text, which just doesn't make any sense.
  6. A timer control is largely unnecessary. Use the Environment.TickCount property instead.
  7. Before I give you a snippet of JavaScript that is often associated with advertisement popups, I have to ask, why? Why would you want to detect such an event?
  8. Your timing scheme is flawed. Instead of telling the current thread to sleep for 500 milliseconds the code should keep polling the DataAvailable property until data is either present or the procedure times out.
  9. You're overwriting the buffer you've created everytime the contents of the While/End While block execute. Try appending the contents of the newly filled buffer to a variable that isn't going to be overwritten.
  10. That works if each site uses a unique port number, however in the case of most modern web servers, which support virtual hosts, all sites use the same port number and the server differentiates each site by parsing the HTTP request's Host header.
  11. Look into the [mshelp=ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemThreadingThreadClassTopic.htm]Thread class[/mshelp] and its Start method.
  12. <!-- In web.config --> <identity impersonate="true" /> [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconaspnetimpersonation.htm[/mshelp]
  13. There isn't any method available in .NET to do this. You'll either have to use ADOX or create a blank Access database (somewhere on the server) that can be copied and filled with tables.
  14. Use frames.
  15. You can remove the imports statement but you cannot remove the reference. The Visual Basic .NET compiler (vbc.exe) will add the reference regardless, whether a project is compiled from Visual Studio or from the command line. This shouldn't be a concern to anyone however, since the Microsoft.VisualBasic assembly is distributed as an integral part of the .NET Framework.
  16. Dim sFiles() As String = System.IO.Directory.GetFiles("C:\") You can also specify a search pattern like so: Dim sFiles() As String = System.IO.Directory.GetFiles("C:\", "*.bmp")
  17. I'm positive there's a way to do this using WSALookupServiceBegin/Next however my mind is drawing a blank. Have a look into those two functions and let me know if you find anything, as I just don't have the time. Also, while I don't consider this a perfect solution, you can locate the DNS server IPs under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{guid}\ You'd be looking for values named "NameServer", however that value is not present under all of the contained keys.
  18. You can't just assume that the index of the last item is equivalent to the the number of items in the ArrayList. Simply put, it just doesn't work that way. Instead of trying to find the index of the last item why don't you try storing it? The Add method of an ArrayList returns the index of the newly added element. Store this when you add the last value, so you can use it when you need it.
  19. I think the question that both Divil and I have is why you would need a DNS server IP in the first place. Care to enlighten us?
  20. No, you cannot. Neither Java applets nor ActiveX controls (COM) are .NET components. The framework would have no idea how to render these objects.
  21. Give each of the buttons handlers in their onclick events.
  22. The domain name system works my moving up a chain of DNS servers one-by-one, until the domain-to-IP mapping entry being looked for is found. Usually this process starts off at your ISP, and works it way towards the 13 (don't quote me on that exact number) root DNS servers run by UUNET and other large providers. You can determine the DNS servers that your computer primarily uses by typing the following at a command prompt: ipconfig /all Getting this information in .NET is a different story though. Other than an unmanaged solution I believe you're out of luck.
  23. For the same reason that you can't add web controls to a windows form you can't add windows controls to web forms. They exist on two entirely different mediums, and should remain as such. Simply put, you're going to have to separate the ActiveX control, which I wouldn't recommend using in the first place, from your .NET logic. Don't expect to be able to interact with it like you would any of the controls found under System.Web.UI, since the most control you're going to have over it is passing it parameters via Response.Write().
  24. Instead of trying to serialize each Customer object, just serialize the entire ArrayList. IFormatter f = new BinaryFormatter(); Stream s = new FileStream("C:\file.dat", FileMode.Create, FileAccess.Write, FileShare.None); f.Serialize(s, alCustomer); s.Close(); Unless I'm missing something this will be drastically easier.
  25. When you compile your project it should produce a DLL with a filename ending in "*.dll". Take whatever the name of the DLL is, without the extension and place that in the Name attribute, as shown above.
×
×
  • Create New...