C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
svn commit Posted by michaeldune on 13 Feb 2008 at 2:11 AM
hi i want to call subversion from c# i writed code but nothing happens
from command line i can comit but my code not works here is the code :

------------
confiuration file:
----------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="SVNLocation" value="C:\Program Files\Subversion\bin\svn"/>
</appSettings>
</configuration>
-----------
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Diagnostics;
using System.Windows;

namespace ConsoleApplicationSvn
{
class Program
{
static void Main(string[] args)
{

string arguments = "svn commit ";
string path = "data_files.txt";
string comment = " -m csharpcommit";
arguments = arguments + path + comment;
string stringout;
stringout = ExecuteSVN(arguments);
}



private static string ExecuteSVN(string arguments)
{
try
{

Process process = new Process();

process.StartInfo.FileName = ConfigurationManager.AppSettings["SVNLocation"];

process.StartInfo.Arguments = arguments;

process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

process.StartInfo.CreateNoWindow = true;

process.StartInfo.RedirectStandardError = true;

process.StartInfo.RedirectStandardOutput = true;

process.StartInfo.UseShellExecute = false;

process.StartInfo.WorkingDirectory = @"C:\def\abc\";
Environment.CurrentDirectory = @"C:\def\abc\";


process.Start();

process.WaitForExit();

return process.StandardOutput.ReadToEnd();
}
catch (Exception e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
return e.ToString();
}

}

}
}



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.