Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default [Ask VC#] Save file dengan menambahkan Extension

Mo nanya lagi nih gan. Gimana sih caranya menambahkan extension ketika nyimpen file ? Maksudnya gini nih gan Misal program ane buka file txt dengan nama "Coba.txt" trus setelah di proces ama program ane ntar jadinya "Coba.txt.pr". Wa nemu source code VB kek gini contohnya. Ada yg bisa translate k VC# ?


Quote:





Dim fDlgBrowser As New Windows.Forms.OpenFileDialog

Dim initialpath As String



Try

With fDlgBrowser

.CheckFileExists = True



If .ShowDialog = DialogResult.OK Then



initialpath = .FileName

End If

End With



objCryptRSA.FileEncrypt(initialpath, initialpath & ".CRP")





Wa coba kayak gini nih


Quote:





String initialpath;

if (fOpen.ShowDialog() != DialogResult.HasValue)

{

initialpath = fOpen.FileName;

fOpen.DefaultExt = ".pr";

fOpen.AddExtension = true;

objCryptRSA.FileEncrypt(initialpath, initialpath + fOpen.DefaultExt);

}





Tapi malah hasilnya nama extensionnya jadi .txtpr bukan .txt.pr seperti yg aku mau.



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 10:44 AM.


no new posts