Subversion Repositories Code-Repo

Rev

Rev 9 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 48
Line 226... Line 226...
226
            catch (Exception e)
226
            catch (Exception e)
227
            {
227
            {
228
                MessageBox.Show(e.ToString(), "Error");
228
                MessageBox.Show(e.ToString(), "Error");
229
            }
229
            }
230
        }
230
        }
-
 
231
        public static long GetShareSize(string username)
-
 
232
        {
-
 
233
            DirectoryInfo dir = new DirectoryInfo(Settings_Form.sharedFolderLocation + @"\" + username);
-
 
234
            long size = GetDirSize(dir);
-
 
235
            return size;
-
 
236
        }
-
 
237
        private static long GetDirSize(DirectoryInfo input)
-
 
238
        {
-
 
239
            try
-
 
240
            {
-
 
241
                if (input.Exists)
-
 
242
                {
-
 
243
                    long size = 0;
-
 
244
                    FileInfo[] files = input.GetFiles();
-
 
245
                    foreach (FileInfo file in files)
-
 
246
                    {
-
 
247
                        size += file.Length;
-
 
248
                    }
-
 
249
                    DirectoryInfo[] dirs = input.GetDirectories();
-
 
250
                    foreach (DirectoryInfo dir in dirs)
-
 
251
                    {
-
 
252
                        size += GetDirSize(dir);
-
 
253
                    }
-
 
254
                    return size;
-
 
255
                }
-
 
256
                else 
-
 
257
                    return 0;
-
 
258
            }
-
 
259
            catch (Exception e)
-
 
260
            {
-
 
261
                MessageBox.Show(e.ToString(), "Error");
-
 
262
                return 0;
-
 
263
            }
-
 
264
        }
231
        public static void ChangeUserPassword(string username, string password)
265
        public static void ChangeUserPassword(string username, string password)
232
        {
266
        {
233
            try
267
            try
234
            {
268
            {
235
                Process netProcess = new Process();
269
                Process netProcess = new Process();