RPCV2Lib.rpcCracker.get_String C# (CSharp) 메소드

get_String() 공개 메소드

public get_String ( ) : String
리턴 String
        public String get_String()
        {
            uint length = get_uint32();

            String value = "";

            for (int charCount = 0; charCount < length; ++charCount)
                value += get_char();

            if (length % 4 != 0)
                i += (4 - length % 4);

            return value;
        }

Usage Example

예제 #1
0
파일: nfsd.cs 프로젝트: petebarber/NFS
        private void SymLink(rpcCracker cracker, rpcPacker packer)
        {
            diropargs	args	= new diropargs(cracker);
            string		path	= cracker.get_String();
            sattr		attr	= new sattr(cracker);

            String createPath = FileTable.LookupFileEntry(args.DirHandle).Name + @"\" + args.FileName + ".sl";

            Console.WriteLine("Symlink: {0}->{1}", createPath, path);

            fhandle fh;

            if ((fh = FileTable.LookupFileHandle(createPath)) == null)
                fh = FileTable.Add(new FileEntry(createPath));

            try
            {
                FileStream symlink = new FileStream(createPath, FileMode.CreateNew, FileAccess.Write);

                try
                {
                    UTF8Encoding pathUTF8 = new UTF8Encoding();

                    byte[] buf = pathUTF8.GetBytes(path);

                    symlink.Write(buf, 0, buf.Length);

                    packer.setUint32((uint)NFSStatus.NFS_OK);
                }
                finally
                {
                    symlink.Close();
                }
            }
            catch(IOException)
            {
                if (new FileInfo(createPath).Exists == true)
                    throw new NFSStatusException(NFSStatus.NFSERR_EXIST);
                else
                    throw;
            }
        }
All Usage Examples Of RPCV2Lib.rpcCracker::get_String