我在 Edit写了一些东西  然后点一个 button   然后选择目录保存他
然后在打开他到Edit中显示出来~!~!
谁能帮帮忙啊
? 或着加我QQ53752069 给我发个 源码过来参考下~!~!~

解决方案 »

  1.   

    直接把Edit框的字符按二进制形式写进文件不就OK了
    sprintf就可以搞定
      

  2.   

    嗯,使用DDX将EDIT对应到一个CString的变量中然后再将变量值打印出来
      

  3.   

    给Buton添加一个事件然后Write()咯,
      

  4.   

    void CTest_3Dlg::OnTxtsave() 
    {
    // TODO: Add your command handler code here
    CString path;
    if (ntxt==0)
    {
    MessageBox("第一次运行请设置文件保存的文件夹");
    LPITEMIDLIST  pidlPath;  
    char  pszDplName[MAX_PATH];  
    BROWSEINFO  biFile;  
    IMalloc  *pDllMlc;  
    biFile.hwndOwner  =  m_hWnd;  
    biFile.pidlRoot  =  NULL;  
    biFile.pszDisplayName  =  NULL;  
    biFile.lpszTitle  =  "请打开要保存的目的文件夹";  
    biFile.ulFlags  =  BIF_RETURNFSANCESTORS;  
    biFile.lpfn  =  NULL;  
    biFile.lParam  =  NULL;  
    biFile.iImage  =  0;  
    if(SUCCEEDED(SHGetMalloc(&pDllMlc)))  
    {  
    pidlPath=SHBrowseForFolder(&biFile);  
    if(pidlPath  !=  NULL)  
    SHGetPathFromIDList(pidlPath,pszDplName);//pszDplName:文件的路径地址  
    else return;  
    pDllMlc->Free(NULL);  
    pDllMlc->Release();  
    }
    path=pszDplName;
    path+="\\";
    }
    CFile Tfile(path+"data.txt", CFile::modeCreate | CFile::modeReadWrite);
    Tfile.Write(alldata,alldata.GetLength());
    }
      

  5.   

       CFileDialog inDlg(FALSE, NULL, NULL, NULL, szFilter, NULL);
    inDlg.m_ofn.lpstrTitle = _T("打开需要提取字库的文本"); 
        inDlg.m_ofn.lpstrFile = fileBuffer;/  
    if (inDlg.DoModal () == IDOK)
    {
    m_openname=inDlg.GetPathName ();
        GetDlgItem (IDC_EDIT1)->SetWindowText(m_openname);///显示路径
             }
    这样就实现显示了
      

  6.   

    正好这几天在做个东西其中一部分跟你说的差不多,希望有点帮助。 保存: txt格式  CStdioFile file;
    CString tStr;
    /////
    if(reg[ws.cr].HaveData==0)
    {
    MessageBox("  无数据可保存!");
    return;

    }
    CFileDialog dlg(FALSE,KZM,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
    "荧光数据文件(*."+KZM+")|*."+KZM+"|所有文件(*.*)|*.*||",this);
            if(dlg.DoModal()==IDCANCEL)
         return;
    ///////////////
    tStr=dlg.GetPathName();
            if(file.Open(tStr,CFile::modeCreate|CFile::modeWrite)==0)
    {
    MessageBox("打文件"+tStr+"失败!","提示",MB_OK+MB_ICONWARNING);
    return;
    }
    //SaveFileText(&file,SS.RegNum);
    int i=0;
    CString d;
    for(i=0;i<2048;i++)
    {
    d.Format("%d",int(reg[ws.cr].data[i]));
    file.WriteString(d+"\n");
    }
    file.Close();
      

  7.   

    写出来;
     我的是根据数据画图形 基本上差不多,
    CString lj;
    CString mStr;    CFileDialog dlg(TRUE,KZM,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
    "荧光数据文件(*."+KZM+")|*."+KZM+"|所有文件(*.*)|*.*||",this);
        if(dlg.DoModal()==IDCANCEL)
    return;
    lj=dlg.GetPathName();
    CStdioFile file;
    if(file.Open(lj,CFile::modeRead)==0)
    {
    MessageBox("打开文件"+lj+"失败!","警告",MB_OK+MB_ICONWARNING);
    return;
    }
    for(int i=0;i<2048;i++)
    {
    file.ReadString(mStr);
    reg[ws.cr].data[i]=atoi(mStr);
    }
        file.Close();
    reg[ws.cr].HaveData=TRUE;
    reg[ws.cr].Showed=TRUE; int sel=m_wndTabBar.GetCurSel();
      if(sel==0)
    {
    //画出图形
    CMosView *p0=(CMosView *)m_wndTabBar.GetItemView(0);
    //p0->Coordinate();
    p0->Showcurve();
    //p0->DrawCurve();
    }
    if(sel==1)
    {
    CTestListView *p1=(CTestListView *)m_wndTabBar.GetItemView(1);
    p1->ShowData();
    }