I have added an .hta
file to my applciation's resources like so:
And I would like to display this by using the line:
Process.Start("explorer.exe", @"PathToFile.hta");
This works when the file is on my system, but when I try displaying the .hta
with:
Process.Start("explorer.exe", Properties.Resources.htatest);
I see this error:
There is no program associated to perform the requested action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.
Is it possible to store an .hta
in my project resources and then call it from the Program?
For reference, here is the code which exists inside the .hta
:
<html>
<head>
<title>IT Support - Message</title>
</head>
<script language = "VBScript">
window.setInterval "setfocus()", 100
Function setfocus
window.focus()
End Function
</script>
<body>
<div style="margin-top:10%;">
<h1 style="font-family:Segoe UI; color:#AF2B71; text-align: center; margin-top: 100pt">Message Heading</h1>
<p style="font-family:Segoe UI; text-align: center"><strong/>This is a message which will be displayed to the user. </p>
</div>
</body>
</html>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…