Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Microsoft's recomended conventions - very detailed. also a good tool for checking public members if you are designing a class library is fxcop
  2. try either Process.Start(@"C:\pathto.exe",arguments) //or Process.Start("C:\\pathto.exe",arguments)
  3. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=81573&highlight=adobe
  4. Edit: had chance to look at it. Sheppard earlier seems to have hit on the cause - at the end of the Ticker_Tick sub Studio will be set to 13. Is there a reason you need to check the value so early on in the routine - you will reset it as part of the for next loop anyway. Although the value of Studio does seem to be reference in several places - one of the downside of using global variables is that things can get confusing, plus changes can have unforseen consequences. You maybe better of moving some of those variables into classes or structures and providing Methods / Properties to acces them - at least that way you can see when they are being modified and provide centralised validation.
  5. Dim intArray() As Integer = {1, 2, 3, 4, 5, 6} int[] intArray = {1,2,3,4,5,6};
  6. If you could post your code it would help us to find the problem...
  7. Never done it myself but wouldn't writting an Outlook add-in be an easier way?
  8. You have entered text into a textbox that contains potentially dangerous or malicious content (probably HTML tags) - this is blocked by default. If you want to allow this kind of input - open the aspx page in the html view and find the page directive <@% Page ....%> bit near the top and before the closing %> add validateRequest=false However this could open your website to abuse / attack. It may be helpful if you give us a bit more background on what you are doing - there may be an easier/safer alternative.
  9. not tested but a quick port to vb.net Function CropSentence(ByVal strText As String, ByVal intLength As Integer, ByVal strTrial As String) As String Dim wsCount As Integer Dim intTempSize As Integer Dim intTotalLen As Integer Dim strTemp As String Dim arrTemp() As String wsCount = 0 intTempSize = 0 intTotalLen = 0 intLength = intLength - Len(strTrial) strTemp = "" If strText.Length > intLength Then arrTemp = strText.Split(" ") For Each x As String In arrTemp If strTemp.Length <= intLength Then strTemp = strTemp & x & " " End If Next Return strTemp.Substring(0, strTemp.Length - 1) & strTrial Else Return strText End If End Function
  10. Looks very nice so far Divil.
  11. http://www.b3ta.com http://www.remakes.org http://www.theregister.co.uk http://www.firingsquad.com http://www.somethingawful.com
  12. Easiest way is create a class to hold the items you want and override the tostring method to return what you would like displayed. The listbox.items.add() method takes any object and calls it's ToString method to get the text to display.
  13. string s = "~A ~B ~C3 ~D"; string[] result; result = s.Split('~'); short and sweet ;)
  14. If it's readonly and databound couldn't you limit the amount of text it's binding to?
  15. If you want to get the control to appear on the toolbox the easiest way is create a new project (or add a new project to the solution) and select windows control library. Delete the control that's part of the project and move your control to the new project and build the solution. If you right click on the tool box and select add/remove items (i think) and then browse for the dll that was created from the new project. Select it and your control should now appear on the toolbox.
  16. You may be better off having a look at Forms Authentication in ASP.Net - fairly easy to set up and does what you need.
  17. That would have been the problem - if IIS is installed then it integrates as part of the VS installation, if it isn't the n you need to do the fix I posted above. As to working remotely if the server has .NET framework and Frontpage extensions installed then when you create a new project you can enter a url of http://remote server/websitename and it should work.
  18. You could throw an exception if the parameters aren't valid but that wouldn't get round this problem. You could make the Sub new private (or protected) and provide a shared public sub that accepts the parameters and does the validation - if everything's fine it creates and returns a valid instance, if not it returns nothing. e.g. Public Class TestClass Private X, Y As Integer Private Sub New(ByVal i As Integer, ByVal j As Integer) X = i Y = j End Sub Public Shared Function CreateTest(ByVal i As Integer, ByVal j As Integer) As TestClass If i < j Then 'Do your validation Dim tmp As New TestClass(i, j) Return tmp Else Return Nothing End If End Function End Class this can be called like Dim t As New TestClass 'invalid Dim t1 As TestClass t1 = TestClass.CreateTest(1, 2) 'valid instance returned Dim t2 As TestClass t2 = TestClass.CreateTest(2, 1) 'nothing is returned
  19. Just tried it here - very odd. The buttons code behind is just Label1.Text = RadioButtonList1.SelectedIndex.ToString put a break point on the line and RadioButtonList1.SelectedIndex.ToString shows up as "2" in hte watch window. Step into the code and you still get the NullReferenceException
  20. What do you have in your Page_Load event handler?
  21. If you just selected the C++ Console application (.Net) template then by default it does use the .Net Framework. If you went for a Win32 console project that doesn't. If you need to check - bring up the project properties and under 'configuration properties' -> 'general' you shoul find an entry for 'Managed Extensions'. If this is set to false then the framework is not required. However you may still need to deploy C runtime / MFC runtimes depending on other options.
  22. If you declare it like you have you shouldn't need the find control bit.
  23. You can declare a variable in the code-begind of the same name and type e.g. If you drag a webcontrol of type mycontrol onto a webpage and it has the name mycontrol1 in the code behind declare it as protected mycontrol1 as mycontrol
  24. looks like the framework didn't register with IIS (happens from time to time) what you'll need to do is the following. Open a new command prompt Change to the drive windows is installed in (e.g. c:\) cd Windows\microsoft.net\framework depending on the version of the frame work you have you will have to cd into either v1.0.3705 or v1.1.4322 - if both folders are present go for the v1.1.4322 one then type aspnet_regiis /i and let it do it's stuff. when it finishes - try to run the web app again and see what happens.
  25. The problem you are having is that GetValue is a shared class member and Run isn't. Shared members of a class work without a specific instance i.e. you could do something like Class1.GetValue("dsafsdafsadf") but non-shared members need a specific instance to be created i.e. dim c as new class1 c.Run("ewrewrwerwerewr") Is there any reason GetValue is shared? It may help if you gave a bit more background on what you are trying to do though.
×
×
  • Create New...