Jump to content
Xtreme .Net Talk

russgreen

Avatar/Signature
  • Posts

    29
  • Joined

  • Last visited

About russgreen

  • Birthday 09/24/1977

Personal Information

  • Visual Studio .NET Version
    Visual Basic.NET standard
  • .NET Preferred Language
    VB.NET

russgreen's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Was yours anything like this? Public Function PopulateComboFromFile(ByVal ListControl As ComboBox, ByVal FullPath As String, _ ByVal Blank As Boolean, Optional ByVal Delimiter As String = vbCrLf) As Boolean Dim objFso As New Scripting.FileSystemObject() Dim objTextStream As Scripting.TextStream Dim strContents As String Dim arrContents() As String Dim lCtr As Long, lCount As Long Try 'Ensure file exists If Dir(FullPath) = "" Then MsgBox("The file " & FullPath & " does not exist", MsgBoxStyle.OKOnly, "Load contract lists") Exit Function End If 'Get file contents objTextStream = objFso.OpenTextFile(FullPath, Scripting.IOMode.ForReading) strContents = objTextStream.ReadAll objTextStream.Close() 'Split file contents based on delimiter arrContents = Split(strContents, Delimiter) lCount = UBound(arrContents) ListControl.Items.Clear() 'Clear List Control. ListControl.Items.AddRange(arrContents) 'Populate list control If Blank = True Then ListControl.Items.AddRange(New Object() {" "}) 'add blank rows to each combo End If PopulateComboFromFile = True Catch ex As Exception objTextStream = Nothing objFso = Nothing MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Load contract lists") End Try End Function
  2. I'm using a Setup Project in VB.NET 2003 Standard to install a windows service application. I would like this installer to start the service after install. How do I do that? Thanks, Russ
  3. how would you get a service to restart itelf?
  4. Ok, sort of worked it out with this <asp:HyperLink id="HyperLink1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.CompanyName") %>' NavigateUrl='<%# "db_project_bus-card.aspx?tbl=ClientCorp&ID=" & Databinder.Eval (Container, "DataItem.ClientCorpID") %>' Font-Size="Small" Font-Names="Arial" Font-Bold="True" ForeColor="Blue"></asp:HyperLink> but cannot get by javascript to work. Quotes get closed early...
  5. I'm trying to pass multiple arguements from one page to another in the URL. I'm using a hyperlink control inside a datalist and I'm trying to add the value that this HTML string would normally be able to get '<%# DataBinder.Eval(Container, "DataItem.ClientCorpID") %>' into the URL here:- db_project_bus-card.aspx?tbl=ClientCorp&ID= " some value to go here " How can I do this? My HTML currently looks like this:- <asp:HyperLink id="HyperLink1" runat="server" ForeColor="Blue" Font-Bold="True" Font-Names="Arial" Font-Size="Small" NavigateUrl="JAVASCRIPT:openPopWin('db_project_bus-card.aspx?tbl=ClientCorp&ID= " some value to go here " ', 400, 400)" Text='<%# DataBinder.Eval(Container, "DataItem.CompanyName") %>' ></asp:HyperLink> I also have another similar problem. I have a hyperlink control that gets its link value (an email address) from a dataset in a similar way but I want to add "mailto:" to the URL. I guessed it would be as below but it obviously doesn't work. Is this possible? <asp:HyperLink id="hplEml" runat="server" text='<%# DataBinder.Eval(Container, "DataItem.Email") %>' Font-Size="X-Small" Target="_blank" navigateURL="mailto:" + '<%# DataBinder.Eval(Container, "DataItem.Email") %>' BackColor="White" ></asp:HyperLink> Thanks in advance. Russ db_list_client-corp.zip
  6. same as davemcminoway I am in axactly the same position as davemcminoway. Using a datagrid and I want to trap the Broswer refresh to reload my data but not actually refresh the browser. You end up with the update command going off when it shouldn't.
  7. I need the refrence to Windows.Forms to interact with the desktop in order to write to the log files. I just had a go with System.Reflection.Assembly.GetExecutingAssembly.Location but it didn't work. How does UDP perform?
  8. I have narrowed down the problem. :D I get my service working fine now with the on start Dim watcherThread As Thread = New Thread(AddressOf listener) Protected Overrides Sub OnStart(ByVal args() As String) WriteToLog("logs\webproxy.log", "Service started") watcherThread.Start() End Sub the listener code is this Private Sub listener() Dim tcplistener As New TcpListener(port) tcplistener.Start() WriteToLog("logs\webproxy.log", "Listening on port " & port.ToString) 'While True ' Dim socket As Socket = tcplistener.AcceptSocket() ' Dim webproxy As New WebProxy(socket) ' Dim thread As New Thread(New ThreadStart(AddressOf webproxy.runproxy)) ' thread.Start() 'End While End Sub :confused: The problem code has been commented out. How else can I continuously monitor the tcp port for sockets? :mad: My WriteToLog isn't working in a service either. Any ideas? It works in all my winforms and console apps. :confused: Is there a service equivalent of Application.Startuppath? Public Sub WriteToLog(ByVal Filename As String, ByVal Comment As String) Dim sw As System.IO.StreamWriter Try sw = New System.IO.StreamWriter(Filename, True) sw.WriteLine(Date.Now & " " & Comment) sw.Flush() Catch e As Exception Finally If Not sw Is Nothing Then sw.Close() End Try End Sub Russ
  9. It seems to work OK but as you probably noticed there are some lines of code commented out that should write to a log file. When I uncomment this code it fails to write to the log so I'm not really sure if its doing its job. I made a console version which works well so I know the main bulk of the code is OK but this is my first go at programming a service. Russ
  10. So you think my code looks OK?
  11. I've posted the project in its current state here. WebProxy Russ
  12. Great thanks, I've just done that, created a service and installer and installed my service. It show up in the list of services now but when trying to start it it takes too long and the status is stuck on starting. Any ideas? Russ
  13. Does anyone know of a macro or way of enabling Windows service projects to be created in VB.NET standard? Thomas Erdösi has written a fantastic macro to enable new projects to be compiled to dll's. If not the would someone be kind enough to create a new blank windows service project for me? Russ
  14. I figured that one out as well. It did work when the folder existed. I'm going to try to extend your code if you don't mind. I want to be able to create folders, delete files and possible executre ReadMe files when a user updates the app. It should only be a small extension to make all that possible though. Russ
  15. OK I miss understood the files. Wow. This really is good code.. I am getting errors though when trying to use subfolders. Can someone just clarify how its supposed to work if I need to put a file in a subdirectory on the local machine ? I have this as my update.dat file but it genrates errors. [VERSIONLIST] VERSION=1.2.2 updateinformation=Welcome to the updater for Project Database Suite [uPDATELIST] # If the version is > 1 e.g. 1.0.1 - 1.0.0 = 1 where 1.0.1 is download version then download # all files marked FILE# *numbers must be in sequence* # you can include subfolders e.g. myfolder/myfile the subfolder is the folder located on the # computer being downloaded to NOT the HTTP server #FILE1=<FILENAME> #FILE2=<FILENAME> #FILE3=<FILENAME> #FILE4=<FILENAME> FILE1=lists/folders.lst # If the version is > 1 e.g. 1.0.2 - 1.0.0 = 2 where 1.0.1 is download version then download # all files marked FILE-UPDATE# *numbers must be in sequence* #FILE-UPDATE1=<FILENAME> #FILE-UPDATE2=<FILENAME> #FILE-UPDATE3=<FILENAME> #FILE-UPDATE4=<FILENAME> FILE-UPDATE1=folders.lst # Created by Andrew Duff, (C) 2003 This is the line in the log file... 05/04/2003 15:46:54 ERRROR Could not find a part of the path "D:\Development Resources\Downloads\Updater.Net\bin\TEST\Downloading_lists\folders.lst"., 76 Russ
×
×
  • Create New...