【问题标题】:how to block application for ever with remote如何使用遥控器永久阻止应用程序
【发布时间】:2016-01-06 14:31:12
【问题描述】:

我知道阻塞系统,但这种方式不安全

        Dim ws As New WebClient
        Dim str As String = ws.DownloadString("http://blocksys.com/Devil.txt")
        If str = "blocking" Then
            MessageBox.Show("This application has been blocked by administrator", "Application blocked", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        End If
    End If

这种方式不安全所以

请教我另一种方法

谢谢你

【问题讨论】:

标签: vb.net


【解决方案1】:
Imports System.Net
Public Class Form1
    Private url As String

    Private Function CheckSite(ByVal url As String) As String
        Dim Block As Boolean = False
        Dim blocklist As String = "blocksys.com,abc.com,domain.com,another.com"
        Dim myList As String() = blocklist.Split(New Char() {","c})
        For Each checkBlock As String In myList
            If url.IndexOf(checkBlock) <> -1 Then Block = True
        Next
        Return Block
    End Function

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        url = TextBox1.Text
        If CheckSite(url) = True Then
            MessageBox.Show("This application has been blocked by administrator", "Application blocked", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Exit Sub
        Else
            Dim ws As New WebClient
            ws.DownloadString(url)
            'Another process........
        End If
    End Sub
End Class

为您的表单添加文本框和按钮并进行测试。

【讨论】:

  • 你想要什么?按域或域/页面阻止?
猜你喜欢
  • 1970-01-01
  • 2012-09-23
  • 2018-02-08
  • 1970-01-01
  • 2014-08-09
  • 1970-01-01
  • 2021-03-08
  • 1970-01-01
相关资源
最近更新 更多