Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
Windows Forms
editing a config text file with checkboxes
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Nucleus, post: 143640, member: 2990"] I am creating a form to edit the configuration file of apache web server. The 2 modules I started with are mod_actions and mod_alias. [CODE]Public Class ApacheSettings Dim Lines() As String = System.IO.File.ReadAllLines("C:\webserver\Apache2.2\conf\httpd.conf") Private Sub ApacheSettings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Lines(53).StartsWith("LoadModule actions_module modules/mod_actions.so") Then ApacheModActions.Checked = True Else ApacheModActions.Checked = False End If If Lines(54).StartsWith("LoadModule alias_module modules/mod_alias.so") Then ApacheModAlias.Checked = True Else ApacheModAlias.Checked = False End If End Sub Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click If ApacheModActions.Checked = True Then Lines(53) = "LoadModule actions_module modules/mod_actions.so" System.IO.File.WriteAllLines("C:\webserver\Apache2.2\conf\httpd.conf", Lines) Else Lines(53) = "#LoadModule actions_module modules/mod_actions.so" System.IO.File.WriteAllLines("C:\webserver\Apache2.2\conf\httpd.conf", Lines) End If End Sub Private Sub ApacheModAlias_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ApacheModAlias.CheckedChanged If ApacheModAlias.Checked = True Then Lines(54) = "LoadModule alias_module modules/mod_alias.so" System.IO.File.WriteAllLines("C:\webserver\Apache2.2\conf\httpd.conf", Lines) Else Lines(54) = "#LoadModule alias_module modules/mod_alias.so" System.IO.File.WriteAllLines("C:\webserver\Apache2.2\conf\httpd.conf", Lines) End If End Sub End Class[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
Windows Forms
editing a config text file with checkboxes
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom