JunctionFlag implements INetFlag ( ArcObjects 10 .NET SDK Help ). Here you can get UserClassID, UserID and UserSubId
Then with these three info you get EID ( ArcObjects 10 .NET SDK Help ) with GetEID ( in this sample fromEIDJunction )
Then you can use code:
IEnumNetEIDBuilderGEN eids = new EnumNetEIDArrayClass();
eids.ElementType = esriElementType.esriETEdge;
eids.Add(nearestEdgeID);
while (true)
{
int fromEIDJunction, toEIDJunction;
INetTopologyEditGEN netTopology = networkElements as INetTopologyEditGEN;
netTopology.GetFromToJunctionEIDs(nearestEdgeID, out fromEIDJunction, out toEIDJunction);
int edgeCount = netTopology.GetAdjacentEdgeCount(fromEIDJunction);
if (edgeCount == 1)
{
break;
}
bool reverseOrientation;
int adjacentEdge;
int livello = -1;
int eidCurrent = -1;
for (int i = 0; i < edgeCount; i++)
{
netTopology.GetAdjacentEdge(fromEIDJunction, i, out adjacentEdge, out reverseOrientation);
if (reverseOrientation == true) // Junction incoming
{
int userClassID, userID, userSubID;
networkElements.QueryIDs(adjacentEdge, esriElementType.esriETEdge, out userClassID, out userID, out userSubID);
IFeature f = this.GetFeatureClassFromID(userClassID).GetFeature(userID);
bla bla bla