متنبه نقل از آرمیتا ثابتی اشرف :چه نوع فایلی رو می خواین ذخیره کنید؟
نوشته ، عکس و یا ... ؟
فعلا با ++C نمی خواهم. با ویژوال بیسیک.به نقل از hoss :خیلی راحت اگه از c++ استفاده میکنید میتونید اول fstream.h رو include کنید و بعد به وسیله ی توابع fstream این کار رو انجام بدین . شما تو اینترنت کار با فایل در c رو سرچ بکن برات میاره
Dim sFile As String
If Left$(ActiveForm.Caption, 8) = "Document" Then
With dlgCommonDialog
.DialogTitle = "Save"
.CancelError = False
'ToDo: set the flags and attributes of the common dialog control
.Filter = "All Files (*.*)|*.*|Text files|*.txt"
.ShowSave
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileName
End With
Else
ActiveForm.Caption = sFile
End If
ActiveForm.rtftext.SaveFile sFile
Dim sFile As String
If Left$(ActiveForm.Caption, 8) = "Document" Then
''''' شرط if کاملا بی جاست برای ایشون :دی ولی احتمالا از توی یه برنامه درست و حسابی در اومده :دی یعنی یه نوت پدی که نوشته شده با وی بی
With dlgCommonDialog
'''' کار with هم که احتمالا بدونین... لازم نیست مدام تکرارش کنین... راحت .Showsave رو می نویسین و ... ;)
.DialogTitle = "Save"
.CancelError = False
'ToDo: set the flags and attributes of the common dialog control
'' همونطوری که توضیح داده شد، نوع و عنوان و پسوند فایل های مورد نمایش رو مشخص می کنه!
.Filter = "All Files (*.*)|*.*|Text files|*.txt"
.ShowSave
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileName
End With
Else
ActiveForm.Caption = sFile
End If
ActiveForm.rtftext.SaveFile sFile