One text, which Ms. Walker showed The Times, read, “Would it frighten you if I said that I was just interested in good times good wine good food and good sex?”

Mr. Cornish, 66, at first called Ms. Walker’s charges “damned lies” in the Minnesota media. But last month, he reached an agreement with her to resign from office, apologize and pay her legal fees, avoiding a lawsuit. Mr. Cornish did not respond to a request for comment.

Female lawmakers often act as witnesses to harassment. Last year, Representative Kelly Fajardo, a Republican in New Mexico, was out with a young female lobbyist when the lobbyist got a text on her phone from an older, powerful legislator.

“The text said, ‘Hey, let’s talk about this bill, my wife’s not here, come up to my hotel room,’” Ms. Fajardo said. “She didn’t know what to do, and I didn’t know what to do. It’s bothered me ever since.”

A Symbiotic Relationship

The lobbying profession is built on developing trust with lawmakers, often after office hours. Almost all lobbyists routinely throw fund-raisers for lawmakers and direct contributions from political action committees. A close relationship develops, built on money and familiarity. Like any workplace, there are consensual sexual relationships, sometimes extramarital. Some female lobbyists pointed out that there are women in the field who have learned to manipulate men given to flirtation, when it suits their interest.

Thomas K. Norment Jr., the majority leader of the Virginia Senate, admitted to an affair in 2013 with a lobbyist whose firm pushed 63 bills that advanced to the Senate floor. He did not abstain on any of the votes. The relationship was reviewed by the Federal Bureau of Investigation, but no charges were filed.