Click here to Skip to main content
15,895,841 members
Home / Discussions / C#
   

C#

 
GeneralRe: Exception Pin
Christian Graus2-Feb-09 22:28
protectorChristian Graus2-Feb-09 22:28 
GeneralRe: Exception Pin
EliottA3-Feb-09 2:30
EliottA3-Feb-09 2:30 
AnswerRe: Exception Pin
Christian Graus2-Feb-09 21:09
protectorChristian Graus2-Feb-09 21:09 
Questionproblem when making one form a child and other form parent Pin
prasadbuddhika2-Feb-09 20:25
prasadbuddhika2-Feb-09 20:25 
AnswerRe: problem when making one form a child and other form parent Pin
«_Superman_»2-Feb-09 21:33
professional«_Superman_»2-Feb-09 21:33 
AnswerRe: problem when making one form a child and other form parent Pin
Christian Graus2-Feb-09 22:27
protectorChristian Graus2-Feb-09 22:27 
GeneralRe: problem when making one form a child and other form parent Pin
Yasithl3-Feb-09 2:08
Yasithl3-Feb-09 2:08 
QuestionCan you help me translate this .vbs script to C# Pin
Matjaz-xyz2-Feb-09 20:15
Matjaz-xyz2-Feb-09 20:15 
Hi.

I was browsing through one of the my companies PCs and found a script which would be usefull to me if it was in C#.

I, personaly, dont know much of VB, thats why i ask for you - the experts - to take 5 minutes of your time and translate this little piece of code to C#.

Thank you very much in advance!!!!!

The code:
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
Set folder = fso.GetFolder(objArgs(0))
Set tifs = folder.Files
NumberOfFiles = tifs.Count
ReDim Field(NumberOfFiles)
i = 0
For Each file In tifs
	Field(i) = file.Name
	i = i + 1
	If i = NumberOfFiles Then
		Exit For
	End If
Next
destination = AddNewFolder(folder.Path, "Hrbtne")
For i = 0 To NumberOfFiles - 2
	If Right(Field(i), 3) = Right(Field(i+1), 3) Then
		fso.MoveFile folder.Path & "\" & Field(i), destination
		fso.MoveFile folder.Path & "\" & Field(i+1), destination
	End If
Next
Erase Field
EndTime = Timer
MsgBox "Čas izvajanja " & EndTime - StartTime & " sekund."
Set fso = Nothing
Set folder = Nothing
Set tifs = Nothing
	

Function AddNewFolder(path, folderName)
   Dim fso, f, fc, nf
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFolder(path)
   Set fc = f.SubFolders
   Set nf = fc.Add(folderName)
   AddNewFolder = nf.Path & "\"
End Function


Regards,
Matjaž

AnswerRe: Can you help me translate this .vbs script to C# Pin
Expert Coming2-Feb-09 21:07
Expert Coming2-Feb-09 21:07 
GeneralRe: Can you help me translate this .vbs script to C# Pin
Matjaz-xyz3-Feb-09 0:30
Matjaz-xyz3-Feb-09 0:30 
GeneralRe: Can you help me translate this .vbs script to C# Pin
EliottA3-Feb-09 5:48
EliottA3-Feb-09 5:48 
GeneralRe: Can you help me translate this .vbs script to C# Pin
Matjaz-xyz3-Feb-09 5:54
Matjaz-xyz3-Feb-09 5:54 
GeneralRe: Can you help me translate this .vbs script to C# Pin
EliottA3-Feb-09 5:57
EliottA3-Feb-09 5:57 
QuestionWin form to WPF form Pin
Muammar©2-Feb-09 20:12
Muammar©2-Feb-09 20:12 
AnswerRe: Win form to WPF form Pin
N a v a n e e t h2-Feb-09 21:31
N a v a n e e t h2-Feb-09 21:31 
GeneralRe: Win form to WPF form [modified] Pin
Muammar©2-Feb-09 22:34
Muammar©2-Feb-09 22:34 
GeneralRe: Win form to WPF form Pin
N a v a n e e t h2-Feb-09 23:36
N a v a n e e t h2-Feb-09 23:36 
GeneralRe: Win form to WPF form Pin
Muammar©3-Feb-09 2:12
Muammar©3-Feb-09 2:12 
QuestionRunning Console application EXE on other machine Pin
siva4552-Feb-09 19:20
siva4552-Feb-09 19:20 
AnswerRe: Running Console application EXE on other machine Pin
N a v a n e e t h2-Feb-09 19:25
N a v a n e e t h2-Feb-09 19:25 
GeneralRe: Running Console application EXE on other machine Pin
siva4552-Feb-09 19:27
siva4552-Feb-09 19:27 
GeneralRe: Running Console application EXE on other machine Pin
N a v a n e e t h2-Feb-09 19:36
N a v a n e e t h2-Feb-09 19:36 
GeneralRe: Running Console application EXE on other machine Pin
siva4552-Feb-09 19:47
siva4552-Feb-09 19:47 
GeneralRe: Running Console application EXE on other machine Pin
Gideon Engelberth3-Feb-09 3:19
Gideon Engelberth3-Feb-09 3:19 
Questiontreeview Pin
samrat.net2-Feb-09 19:00
samrat.net2-Feb-09 19:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.