Location:
Search - readstring
Search list
Description: <fstream> 类通过重载 >> 操作符来读取文件,重载 << 操作符向文件写入数据。每个操作符都有几个重载的版本,分别用于各种内建的数据类型。
Platform: |
Size: 1254 |
Author: 盛晓峰 |
Hits:
Description: 纯真版IP数据库查询代码原源代码中有一个错误导致取出的地区信息有误
在readFullAddr函数中
if ( byte == REDIRECT_MODE_2 ) {
int p = 0
fread(&p,1,3,dbfile)
address = readString(p)
fseek(dbfile,p+4,SEEK_SET)
这段中
最后一句fseek(dbfile,p+4,SEEK_SET)
应改为
fseek(dbfile,countryOffset+4,SEEK_SET)
否则取出的区域地址将会是国家地址的略过4个字符后的内容
比如原来应该取出 “中国上海 电信adsl”
现在会变成 “中国上海 上海”
现在发布的是经过我改动后的版本
bug信息已经通知原作者并且他已经作了修复
Platform: |
Size: 2079 |
Author: 1111 |
Hits:
Description: VC读写文本文件, CString strLine
while(file.ReadString(strLine)){str = strLine + \"P-Tree\" a<<str<<end
Platform: |
Size: 38227 |
Author: yangyong |
Hits:
Description: 主要源码:
void CFDlg::OnChangeEdit1()
{
UpdateData()
m_strExt.MakeUpper()
m_list.ResetContent()
if(m_strExt.GetLength()==0) return
CStdioFile sf
if(sf.Open(\"FileExt.txt\",Cfile::modeRead))
{
CString strTemp,strOut
while(sf.ReadString(strTemp))
{
if(strTemp.Left(m_strExt.GetLength()) ==m_strExt)
{
m_list.AddString(strTemp)
}
}
}
sf.Close()
m_list.SetCurSel(0)
this->OnSelchangeList2()
}
void CFDlg::OnSelchangeList2()
{
CString strTemp,strExt
m_list.GetText(m_list.GetCurSel(),strTemp)
strExt=strTemp.Left(strTemp.FindOneOf(\" \")) //MessageBox(strExt)
CString strFileName =\"eee.\"+strExt //MessageBox(strFileName)
SHFILEINFO shfi
memset(&shfi,0,sizeof(shfi)) //或者ZeroMemory(&shfi,sizeof(shfi))
::SHGetFileInfo(strFileName,
FILE_ATTRIBUTE_NORMAL,
&shfi,
sizeof(shfi),
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES)
m_icon.SetIcon(shfi.hIcon)
}
Platform: |
Size: 41579 |
Author: HUGH RENNY |
Hits:
Description: 一个读写Ini文件的类,开发平台VB6.0-a reader Ini document type, development platforms VB6.0
Platform: |
Size: 7168 |
Author: |
Hits:
Description: <fstream> 类通过重载 >> 操作符来读取文件,重载 << 操作符向文件写入数据。每个操作符都有几个重载的版本,分别用于各种内建的数据类型。-<fstream> category through the overloaded>> operator to read files, overloaded <<operator writes data to the document. Each operator has several overloaded versions, respectively, for a variety of built-in data types.
Platform: |
Size: 1024 |
Author: 盛晓峰 |
Hits:
Description: 纯真版IP数据库查询代码原源代码中有一个错误导致取出的地区信息有误
在readFullAddr函数中
if ( byte == REDIRECT_MODE_2 ) {
int p = 0
fread(&p,1,3,dbfile)
address = readString(p)
fseek(dbfile,p+4,SEEK_SET)
这段中
最后一句fseek(dbfile,p+4,SEEK_SET)
应改为
fseek(dbfile,countryOffset+4,SEEK_SET)
否则取出的区域地址将会是国家地址的略过4个字符后的内容
比如原来应该取出 “中国上海 电信adsl”
现在会变成 “中国上海 上海”
现在发布的是经过我改动后的版本
bug信息已经通知原作者并且他已经作了修复-Pure IP database query code version of the original source code has an error out of the region led to an error in the information readFullAddr function if (byte == REDIRECT_MODE_2) (int p = 0 fread (
Platform: |
Size: 2048 |
Author: 1111 |
Hits:
Description: VC读写文本文件, CString strLine
while(file.ReadString(strLine)){str = strLine + "P-Tree" a<<str<<end-VC to read and write text files, CString strLine while (file.ReadString (strLine)) (str = strLine+ P-Tree a
Platform: |
Size: 1987584 |
Author: yangyong |
Hits:
Description: 主要源码:
void CFDlg::OnChangeEdit1()
{
UpdateData()
m_strExt.MakeUpper()
m_list.ResetContent()
if(m_strExt.GetLength()==0) return
CStdioFile sf
if(sf.Open("FileExt.txt",Cfile::modeRead))
{
CString strTemp,strOut
while(sf.ReadString(strTemp))
{
if(strTemp.Left(m_strExt.GetLength()) ==m_strExt)
{
m_list.AddString(strTemp)
}
}
}
sf.Close()
m_list.SetCurSel(0)
this->OnSelchangeList2()
}
void CFDlg::OnSelchangeList2()
{
CString strTemp,strExt
m_list.GetText(m_list.GetCurSel(),strTemp)
strExt=strTemp.Left(strTemp.FindOneOf(" ")) //MessageBox(strExt)
CString strFileName ="eee."+strExt //MessageBox(strFileName)
SHFILEINFO shfi
memset(&shfi,0,sizeof(shfi)) //或者ZeroMemory(&shfi,sizeof(shfi))
::SHGetFileInfo(strFileName,
FILE_ATTRIBUTE_NORMAL,
&shfi,
sizeof(shfi),
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES)
m_icon.SetIcon(shfi.hIcon)
}-Main source: void CFDlg:: OnChangeEdit1 () (UpdateData () m_strExt.MakeUpper () m_list.ResetContent () if (m_strExt.GetLength () == 0) return CStdioFile sf if (sf.Open (FileExt.txt, Cfile :: modeRead)) (CString strTemp, strOut while (sf.ReadString (strTemp)) (if (strTemp.Left (m_strExt.GetLength ()) == m_strExt) (m_list.AddString (strTemp)))) sf.Close ( ) m_list.SetCurSel (0) this-
Platform: |
Size: 40960 |
Author: HUGH RENNY |
Hits:
Description: 主要通过CStdioFile类的ReadString方法实现,用于一次读取文本文件的一行-Mainly through CStdioFile method ReadString category for the first line to read a text file
Platform: |
Size: 1880064 |
Author: 张国辉 |
Hits:
Description: ini 文件解析器(类),将ini文件的读写等操作进行了封装,使用标准的输入输出等简单的库(string、stdio、stdlib),输入文件名 段名 条目名就可以解析出结果。通过ReadInt(),ReadString(),Write()3个主要函数实现。-an implementation of initialization file parser, only few stand libs needed(sting.h, stdio.h, stdlib.h), 3 main functions are ReadInt(), ReadString(), Write() to reach the goals of reading and writing in the ini file.
Platform: |
Size: 5120 |
Author: Gavin |
Hits:
Description: 本例中TRegistry是关键类,Delphi 4.0不能自行加入,需在uses部分手工加入registry,通过其方法ReadString和WriteString来读出和写入字符,亦可通过其方法“ReadDate”和“WriteDate”来读出和写入日期。 -The this example TRegistry key class, Delphi 4.0 not self-join, to be added manually in the uses part REGISTRY ReadString and WriteString through its approach to read out and write characters, but also by its method " ReadDate" and " writeDate read and write date.
Platform: |
Size: 9216 |
Author: kw |
Hits:
Description: VC++从文本文件中读取一个字符串,字符串已经内置在文本文件里,在窗体的空白处点击右键可看到效果。-VC++ read a string from a text file, the string has built-in text file, right-click to see the effect in the space of the form.
Platform: |
Size: 32768 |
Author: 罗学军 |
Hits:
Description: 有一个TXT文件,每一行是一条记录,记录的每一个字段之间用tab隔开用ReadString可以把一行读入一个缓冲区,我怎么把单个字段的值读出来呢-There is a TXT file, and each row is a record, recorded between each field tab separated ReadString can line read into a buffer, how do I read the value of a single field.
Platform: |
Size: 17408 |
Author: 李浩 |
Hits:
Description: ini 文件解析器(类),将ini文件的读写等操作进行了封装,使用标准的输入输出等简单的库(string、stdio、stdlib),输入文件名 段名 条目名就可以解析出结果。通过ReadInt(),ReadString(),Write()3个主要函数实现。-an implementation of initialization file parser, only few stand libs needed(sting.h, stdio.h, stdlib.h), 3 main functions are ReadInt(), ReadString(), Write() to reach the goals of reading and writing in the ini file.
Platform: |
Size: 5120 |
Author: huang951358 |
Hits:
Description: using HslCommunication.ModBus;
using HslCommunication;
// 读取操作
bool coil100 = busTcpClient.ReadCoil("100").Content; // 读取线圈100的通断
short short100 = busTcpClient.ReadInt16("100").Content; // 读取寄存器100的short值
ushort ushort100 = busTcpClient.ReadUInt16("100").Content; // 读取寄存器100的ushort值
int int100 = busTcpClient.ReadInt32("100").Content; // 读取寄存器100-101的int值
uint uint100 = busTcpClient.ReadUInt32("100").Content; // 读取寄存器100-101的uint值
float float100 = busTcpClient.ReadFloat("100").Content; // 读取寄存器100-101的float值
long long100 = busTcpClient.ReadInt64("100").Content; // 读取寄存器100-103的long值
ulong ulong100 = busTcpClient.ReadUInt64("100").Content; // 读取寄存器100-103的ulong值
double double100 = busTcpClient.ReadDouble("100").Content; // 读取寄存器100-103的double值
string str100 = busTcpClient.ReadString("100", 5).Content;// 读取100到104共10个字符的字符串
// 写入操作
busTcpClient.WriteCoil("100", true);// 写入线圈100为通
busTcpClient.Write("100", (short)12345);// 写入寄存器100为12345
busTcpClient.Write("100", (ushort)45678);// 写入寄存器100为45678
busTcpClient.Write("100", 123456789);// 写入寄存器100-101为123456789
busTcpClient.Write("100", (uint)123456778);// 写入寄存器100-101为123456778
busTcpClient.Write("100", 123.456);// 写入寄存器100-101为123.456
busTcpClient.Write("100", 12312312312414L);//写入寄存器100-103为一个大数据
busTcpClient.Write("100", 12634534534543656UL);// 写入寄存器100-103为一个大数据
busTcpClient.Write("100", 123.456d);// 写入寄存器100-103为一个双精度的数据
busTcpClient.Write("100", "K123456789");
Platform: |
Size: 353186 |
Author: cff621628@126.com |
Hits: