Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

byka

@byka
About
Posts
179
Topics
104
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • jquery chatbot code example for static answers
    B byka

    Could you please provide code example with jquery chatbot code example for static answers?

    Web Development javascript tutorial question

  • ImageButton inside Datalist
    B byka

    I have datalist with imageButton generated from folder with Images. I am trying to change border on clientClick event to indicate that user selected that image. I was able to get click event for image but how to I unselect others images? function ccSelectedImage(e) { { alert(e); e.style.border = "1px solid Red"; return false; } }

        Dim dir As DirectoryInfo = New DirectoryInfo(MapPath("Images"))
        Dim files As FileInfo() = dir.GetFiles()
        Dim listItems As ArrayList = New ArrayList()
    
        For Each info As FileInfo In files
            listItems.Add(info)
        Next
    
        dtlist.DataSource = listItems
        dtlist.DataBind()
    
    Web Development architecture tutorial question

  • Open template word doc and replace values
    B byka

    Below is my code. I can't figure out how to find specific text and replace it

    Dim byteArray As Byte()
    Dim myDataTable As DataTable = objDB.GetTemplates(plan.YearCode, "Templates", plan.State)

            If Not myDataTable Is Nothing AndAlso myDataTable.Rows.Count > 0 Then
                byteArray = DirectCast(myDataTable.Rows(0).Item("Template"), Byte())
            Else
                Throw New Exception("Unable to retrieve the specified template")
            End If
    
    
            Using mem As MemoryStream = New MemoryStream
                mem.Write(byteArray, 0, CInt(byteArray.Length))
                Using doc As WordprocessingDocument = WordprocessingDocument.Open(mem, True)
    
                ??? How do I find specific word and replace it
                
               Helper.DownloadStream("Schedule" &" .docx", mem, Helper.WORD\_CONTENT\_TYPE)
                End Using
            End Using
    
    ASP.NET question

  • Open template word doc and replace values
    B byka

    I have a web application where I have a template (word) which I need to open/save and replace some values at run time. How do I do this?

    ASP.NET question

  • Extract numbers with % sign from a string
    B byka

    got it. thank you

    ASP.NET tutorial

  • Extract numbers with % sign from a string
    B byka

    what am I doing incorrect: Dim number = Regex.Match("50%", "\d+$").Value number is empty

    ASP.NET tutorial

  • Extract numbers with % sign from a string
    B byka

    I need to Extract numbers with % sign from a string. Example: "50%", "test 100%","ttest 50% test test". thank you

    ASP.NET tutorial

  • Windows server OnTimedEvent
    B byka

    here my updated code. I have replace email with : Throw ex. Is that what you mean? I am not sure I am clear on what you have in mind. Could you share maybe the code? :

    Private Sub OnTimedEvent(source As Object, e As ElapsedEventArgs)
    Try

            RetryOnTimeout(source, e)
    
        Catch ex As Exception
            While \_currentRetry < 3
                RetryOnTimeout(source, e)
                \_currentRetry = \_currentRetry + 1
            End While
    
            modCommon.SendEmailExceptionToDev("ASH File System Watcher Outgoing: OnTimedEvent Exception", ex)
            Err.Clear()
        End Try
    
    End Sub
    Private Sub RetryOnTimeout(source As Object, e As ElapsedEventArgs)
        Try
    
            aTimer.Stop()
            Dim fileName As String = String.Empty
    
            While queueList.Count > 0
                If \_SFTP.Connected = False OrElse \_SFTP.SFTPState = Dart.Ssh.ConnectionState.Closed Then
                    \_SFTP.Connect()
                End If
    
                fileName = queueList.Dequeue.ToString
                If Not fileName Is Nothing AndAlso fileName <> String.Empty Then
                    ProcessFile(fileName)
                End If
            End While
    
            If \_SFTP.Connected = True Then
                \_SFTP.Disconnect()
            End If
    
            aTimer.Start()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
    
    Windows Forms sysadmin windows-admin question

  • Windows server OnTimedEvent
    B byka

    Here is what I did: 1.Add new sub: RetryOnTimeout 2. Add retry in Catch. Is this what you suggested ?

    Private Sub OnTimedEvent(source As Object, e As ElapsedEventArgs)
    Try

            RetryOnTimeout(source, e)
    
        Catch ex As Exception
             While \_currentRetry < 3
                RetryOnTimeout(source, e)
                \_currentRetry = \_currentRetry + 1
    
    
            End While         
            modCommon.SendEmailExceptionToDev("OnTimedEvent Exception", ex)
            Err.Clear()       
    

    End Try

    End Sub
    Private Sub RetryOnTimeout(source As Object, e As ElapsedEventArgs)
        Try
    
            aTimer.Stop()
            Dim fileName As String = String.Empty
    
            While queueList.Count > 0
                If \_SFTP.Connected = False OrElse \_SFTP.SFTPState = Dart.Ssh.ConnectionState.Closed Then
                    \_SFTP.Connect()
                End If
    
                fileName = queueList.Dequeue.ToString
                If Not fileName Is Nothing AndAlso fileName <> String.Empty Then
                    ProcessFile(fileName)
                End If
            End While
    
            If \_SFTP.Connected = True Then
                \_SFTP.Disconnect()
            End If
    
            aTimer.Start()
        Catch ex As Exception
            modCommon.SendEmailExceptionToDev("OnTimedEvent Exception", ex)
            Err.Clear()
        End Try
    End Sub
    
    Windows Forms sysadmin windows-admin question

  • Windows server OnTimedEvent
    B byka

    I have the following onTime event in windows server. I would like to try 3 times to connect and submit files before I throw an exception. How would I do this?

    Private Sub OnTimedEvent(source As Object, e As ElapsedEventArgs)

        Try
            aTimer.Stop()
            Dim fileName As String = String.Empty
    
            While queueList.Count > 0
                If \_SFTP.Connected = False OrElse \_SFTP.SFTPState = Dart.Ssh.ConnectionState.Closed Then
                    \_SFTP.Connect()
                End If
    
                fileName = queueList.Dequeue.ToString
                If Not fileName Is Nothing AndAlso fileName <> String.Empty Then
                    ProcessFile(fileName)
                End If
            End While
    
            If \_SFTP.Connected = True Then
                \_SFTP.Disconnect()
            End If
    
            aTimer.Start()
    
        Catch ex As Exception
            modCommon.SendEmailExceptionToDev("OnTimed: OnTimedEvent Exception", ex)
            Err.Clear()
        End Try
    
    Windows Forms sysadmin windows-admin question

  • Error too many changes at once in directory from the filesystemwatcher
    B byka

    I am getting Error too many changes at once in directory from the filesystemwatcher. How do I fix it?

    ASP.NET help question

  • Starting the process as user will not work on Win2012
    B byka

    Maybe this details will help. SID1 have access to cmd.exe and shares. SID2 have access to DB . When I run this I am passing SID2 while accessing cmd.exe under SID1 psi.Domain = Domain psi.UserName = UserName Dim pword As New System.Security.SecureString() For Each c As Char In Password pword.AppendChar(c) Next psi.Password = pword Settings windows to normal don't help

    Visual Basic security

  • Starting the process as user will not work on Win2012
    B byka

    it's a console app and user is admin user and even if I remove Verb = "runas" still getting the same issue

    Visual Basic security

  • Starting the process as user will not work on Win2012
    B byka

    Starting the process as user will not work on Win2012. Getting access Denied and user is an admin

    Dim psi As New System.Diagnostics.ProcessStartInfo
    psi.UseShellExecute = False
    psi.WindowStyle = ProcessWindowStyle.Hidden
    'Win2012 run as admin
    psi.Verb = "runas"

    'This will not for Win2012 need to pass User as argument
    'psi.Domain = Domain
    'psi.UserName = UserName
    'Dim pword As New System.Security.SecureString()
    'For Each c As Char In Password
    ' pword.AppendChar(c)
    'Next
    'psi.Password = pword

    Visual Basic security

  • BCP or Bulk Insert
    B byka

    Do you have a code example how to implement BCP or Bulk Insert in .net using .frm files.

    Visual Basic tutorial csharp

  • CreateProcessAsUser or LogonUser
    B byka

    yes.

    .NET (Core and Framework) security question

  • CreateProcessAsUser or LogonUser
    B byka

    You're writing the scheduler app? - Yes Is this written as a standard console or Windows Forms application or is it a service? - Consolse application Does the application this scheduler is launching have to show up as a window that the user can type in? - No Why must you call CMD instead of just launching BCP directly?- you mean call bcp.exe instead of cmd?

    .NET (Core and Framework) security question

  • CreateProcessAsUser or LogonUser
    B byka

    Maybe this explanation will help : scheduler running under user account with no permission to C: drive. Application account should have some permission to C:drive in order to access cmd.exe I need to add code ( CreateProcessAsUser or LogonUser) for application user in order to call cmd.exe

    .NET (Core and Framework) security question

  • CreateProcessAsUser or LogonUser
    B byka

    it's a console application running on a server from a scheduler. I need to start a process as specific user with access to cmd.exe and pass userID in my process

    .NET (Core and Framework) security question

  • CreateProcessAsUser or LogonUser
    B byka

    How can I use the CreateProcessAsUser or LogonUser when staring the process:

    Dim ps As New System.Diagnostics.Process
    ps.StartInfo.UseShellExecute = False
    ps.StartInfo.Domain = Domain
    ps.StartInfo.UserName = UserName

            Dim pword As New System.Security.SecureString()
            For Each c As Char In Password
                pword.AppendChar(c)
            Next
            ps.StartInfo.Password = pword
            ps.StartInfo.LoadUserProfile = False
    
    
            'This Works:
            ps.StartInfo.WorkingDirectory = ApplicationWorkingDir
            ps.StartInfo.FileName = "cmd.exe"
          
            'Win2012 run as admin
             ps.StartInfo.Verb = "runas"
           
           
            If BatchSize = String.Empty Then
                ps.StartInfo.Arguments = "/c  bcp " + DbTable + " in " + SourceFile + " -m " + MaxErrors + " -f " & FMTFile & " -e " & ErrorFile & " -o " & LogFile & " -S " & ServerName & " -T "
            Else
                ps.StartInfo.Arguments = "/c bcp " + DbTable + " in " + SourceFile + " -m " + MaxErrors + " -f " & FMTFile & " -b" & BatchSize & " -e " & ErrorFile & " -o " & LogFile & " -S " & ServerName & " -T"
            End If
    
            ps.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
            ps.Start()
    
            ps.WaitForExit()
    
    .NET (Core and Framework) security question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups