728x90
[VB.net/C#] Javascript 실행 (msscript.ocx)
Dim script As String
script = Dir_OpenFile("파일.js")
Compile(script)
Private cScript As New MSScriptControl.ScriptControl
Public Function Compile(ByVal NewScriptCode As String) As Boolean
On Error GoTo OnErr
With cScript
.Language = "Javascript"
.Reset()
End With
cScript.AddCode(NewScriptCode)
Compile = True
Exit Function
OnErr:
Dim ErrorLine As Long
With cScript.Error
MessageBox.Show("스크립트 에러가 발생하였습니다." & vbNewLine &
.Description & " at line " & .Line & ".",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation)
ErrorLine = .Line
.Clear()
End With
End Function
Function Dir_OpenFile(ByVal File As String)
Dim fso, FileWriter As Object
fso = CreateObject("scripting.FileSystemObject")
FileWriter = fso.OpenTextFile(File)
Dir_OpenFile = FileWriter.ReadAll
FileWriter.Close()
End Function
728x90
'자료' 카테고리의 다른 글
안드로이드 앱 SSL-Pinning 우회 및 패킷 캡처 (0) | 2021.02.08 |
---|---|
2021년 예비군 원격교육 빠르게 스킵하는방법 (0) | 2021.02.02 |
[올리디버거]더미다/쉘던 우회 플러그인 설정방법 (0) | 2021.01.14 |
[PHP] 13자리 타임스탬프(Timestamp) 만드는법 (0) | 2021.01.09 |
[PHP] AES256 암호화, 복호화 (0) | 2021.01.04 |