我正在尝试编写一个脚本来运行我的一个.jar文件作为守护进程,但我不知道如何.sh在Ubuntu中创建扩展文件.我已经习惯使用vi我想要的代码创建一个文件,但我无法弄清楚如何将文件定义为特定的.sh文件.例如,我想将我的文件" foo"或" foo.txt"转换为" foo.sh".
是否有一个简单的命令,我没有看到可以将文件转换为.sh扩展名,还是一个更复杂的过程?
我在asp中有一个gridview,我已将第一列添加为复选框列.现在我想选择此列并获取该行的id值.但是我没有得到如何做到这一点..
这是我的Aspx代码..
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound"
AutoGenerateColumns="False" BackColor="LightGoldenrodYellow"
BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black"
GridLines="None">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkhdr" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkChild" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Username">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("col0") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Role(Admin)">
<ItemTemplate>
<asp:CheckBox ID="chkAdmin" runat="server" Checked='<%# Eval("col1") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Role(User)">
<ItemTemplate>
<asp:CheckBox ID="chkUser" runat="server" Checked='<%# Eval("col2") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Role(GeneralUser)">
<ItemTemplate>
<asp:CheckBox ID="chkgen" runat="server" Checked='<%# Eval("col3") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView> …Run Code Online (Sandbox Code Playgroud) 我有一个Windows窗体应用程序的维护工作,其中包含窗体的Form_Load方法上的Windows RegistryKey代码.但我不知道是什么工作正在由RegistryKey代码片段执行.这是我的代码令我困惑的是..
try
{
RegistryKey rkStartUp = Registry.LocalMachine;
RegistryKey StartupPath;
StartupPath = rkStartUp.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (StartupPath.GetValue("ABCDXYZ") == null)
{
StartupPath.SetValue("ABCDXYZ", Application.ExecutablePath, RegistryValueKind.ExpandString);
}
}
catch
{
}
Run Code Online (Sandbox Code Playgroud)
任何帮助解释它将受到高度赞赏.