||A linear-optics network is a multimode interferometer system, where indistinguishable photon inputs can create nonclassical interference that cannot be simulated with classical computers. Such nonclassical interference implies the existence of entanglement among its subsystems if we divide its modes into different parties. Entanglement in such systems is naturally encoded in multirail (multimode) quantum registers. For bipartite entanglement, a generation and detection scheme with multirail encoding was theoretically proposed [Wu and Hofmann, New J. Phys. 19, 103032 (2017)] and experimentally realized [Kiyohara et al., Optica 7, 1517 (2020)]. In this paper, we will take a step further to establish a theory for the detection of multirail-encoded discrete-variable genuine multipartite entanglement (GME) in fixed local-photon-number subspaces of linear-optics networks. We also propose a scheme for GME generation with both discrete-variable (single photons) and continuous-variable (squeezed states) light sources. This scheme allows us to reveal the discrete-variable GME in continuous-variable systems. The effect of photon losses is also numerically analyzed for the generation scheme based on continuous-variable inputs.